struct BufferSwapper<T>(Vec<LockedBuffer<T>>);
Expand description
Doesn’t cleanup buffers in any way, so you have to ensure that
Tuple Fields§
§0: Vec<LockedBuffer<T>>
Implementations§
source§impl<T> BufferSwapper<T>
impl<T> BufferSwapper<T>
fn new(bufs: Vec<T>) -> Self
fn len(&self) -> usize
fn all_locked(&self) -> bool
sourcepub fn replace_buffer(
&mut self,
buf: BufProtected<T>,
) -> Result<usize, (BufProtected<T>, &'static str)>
pub fn replace_buffer( &mut self, buf: BufProtected<T>, ) -> Result<usize, (BufProtected<T>, &'static str)>
Finds the kernel index for this buffer and places it there. Doesn’t check if the buffer was there already. Returns the kernel index.
sourcepub fn take_buffer(
&mut self,
index: usize,
) -> Result<BufProtected<T>, &'static str>
pub fn take_buffer( &mut self, index: usize, ) -> Result<BufProtected<T>, &'static str>
Removes and returns buffer at this kernel index.
Auto Trait Implementations§
impl<T> Freeze for BufferSwapper<T>
impl<T> !RefUnwindSafe for BufferSwapper<T>
impl<T> !Send for BufferSwapper<T>
impl<T> !Sync for BufferSwapper<T>
impl<T> Unpin for BufferSwapper<T>
impl<T> !UnwindSafe for BufferSwapper<T>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more