Struct abi::bbqueue_ipc::bbbuffer::SplitGrantR
source · pub struct SplitGrantR<'a> {
pub(crate) buf1: &'a mut [u8],
pub(crate) buf2: &'a mut [u8],
bbq: NonNull<BBBuffer>,
pub(crate) to_release: usize,
}
Expand description
A structure representing up to two contiguous regions of memory that may be read from, and potentially “released” (or cleared) from the queue
Fields§
§buf1: &'a mut [u8]
§buf2: &'a mut [u8]
§bbq: NonNull<BBBuffer>
§to_release: usize
Implementations§
source§impl<'a> SplitGrantR<'a>
impl<'a> SplitGrantR<'a>
sourcepub fn release(self, used: usize)
pub fn release(self, used: usize)
Release a sequence of bytes from the buffer, allowing the space to be used by later writes. This consumes the grant.
If used
is larger than the given grant, the full grant will
be released.
NOTE: if the target doesn’t have atomics, this function takes a short critical section while releasing.
sourcepub fn bufs_mut(&mut self) -> (&mut [u8], &mut [u8])
pub fn bufs_mut(&mut self) -> (&mut [u8], &mut [u8])
Obtain mutable access to both parts of the read grant
This is useful if you are performing in-place operations on an incoming packet, such as decryption
pub(crate) fn release_inner(&mut self, used: usize)
sourcepub fn to_release(&mut self, amt: usize)
pub fn to_release(&mut self, amt: usize)
Configures the amount of bytes to be released on drop.
sourcepub fn combined_len(&self) -> usize
pub fn combined_len(&self) -> usize
The combined length of both buffers
Trait Implementations§
source§impl<'a> Debug for SplitGrantR<'a>
impl<'a> Debug for SplitGrantR<'a>
source§impl<'a> Drop for SplitGrantR<'a>
impl<'a> Drop for SplitGrantR<'a>
source§impl<'a> PartialEq for SplitGrantR<'a>
impl<'a> PartialEq for SplitGrantR<'a>
impl<'a> Send for SplitGrantR<'a>
impl<'a> StructuralPartialEq for SplitGrantR<'a>
Auto Trait Implementations§
impl<'a> Freeze for SplitGrantR<'a>
impl<'a> RefUnwindSafe for SplitGrantR<'a>
impl<'a> !Sync for SplitGrantR<'a>
impl<'a> Unpin for SplitGrantR<'a>
impl<'a> !UnwindSafe for SplitGrantR<'a>
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