pub struct BufferRef(/* private fields */);Expand description
Reference to a VNET buffer
A &mut BufferRef is equivalent to a vnet_buffer_opaque_t * in C (a *vnet_buffer_opaque_t
in Rust).
Implementations§
Source§impl BufferRef
impl BufferRef
Sourcepub unsafe fn from_ptr<'a>(ptr: *const vnet_buffer_opaque_t) -> &'a BufferRef
pub unsafe fn from_ptr<'a>(ptr: *const vnet_buffer_opaque_t) -> &'a BufferRef
Create a &BufferRef from a raw pointer
§Safety
- The pointer must be a valid and properly initialised
vlib_buffer_t. - The pointer must stay valid and the contents must not be mutated for the duration of the lifetime of the returned object.
Sourcepub unsafe fn from_ptr_mut<'a>(
ptr: *mut vnet_buffer_opaque_t,
) -> &'a mut BufferRef
pub unsafe fn from_ptr_mut<'a>( ptr: *mut vnet_buffer_opaque_t, ) -> &'a mut BufferRef
Create a &mut BufferRef from a raw pointer
§Safety
- The pointer must be a valid and properly initialised
vlib_buffer_t. - The pointer must stay valid and the contents must not be mutated for the duration of the lifetime of the returned object.
Sourcepub fn as_ptr(&self) -> *mut vnet_buffer_opaque_t
pub fn as_ptr(&self) -> *mut vnet_buffer_opaque_t
Returns the raw pointer to the underlying vnet_buffer_opaque_t
Sourcepub fn feature_arc_index(&self) -> u8
pub fn feature_arc_index(&self) -> u8
Returns the index of the feature arc that the buffer is being processed from
Auto Trait Implementations§
impl Freeze for BufferRef
impl !RefUnwindSafe for BufferRef
impl !Send for BufferRef
impl !Sync for BufferRef
impl Unpin for BufferRef
impl UnsafeUnpin for BufferRef
impl UnwindSafe for BufferRef
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