pub struct NodeRef<N: Node>(/* private fields */);Expand description
Reference to a VPP node
This is a per-node-instance structure containing metadata about the node and certain node state.
A &mut NodeRef corresponds to vlib_node_t * in C.
Implementations§
Source§impl<N: Node> NodeRef<N>
impl<N: Node> NodeRef<N>
Sourcepub unsafe fn from_ptr_mut<'a>(ptr: *mut vlib_node_t) -> &'a mut Self
pub unsafe fn from_ptr_mut<'a>(ptr: *mut vlib_node_t) -> &'a mut Self
Creates a &mut NodeRef directly from a pointer
§Safety
- The pointer must be valid and a properly initialised
vlib_node_t. - The pointer must stay valid and the contents must not be mutated for the duration of the lifetime of the returned object.
- The
error_heap_indexfield must be set correctly to point to the base index of the node’s error counters in the VPP error main counters array.
Sourcepub fn as_ptr(&self) -> *mut vlib_node_t
pub fn as_ptr(&self) -> *mut vlib_node_t
Returns the raw pointer to the underlying vlib_node_t
Sourcepub fn increment_error_counter(
&self,
vm: &MainRef,
counter: N::Errors,
increment: u64,
)
pub fn increment_error_counter( &self, vm: &MainRef, counter: N::Errors, increment: u64, )
Increments the given error counter by the specified amount
This corresponds to the VPP C function vlib_node_increment_counter.
Auto Trait Implementations§
impl<N> Freeze for NodeRef<N>
impl<N> !RefUnwindSafe for NodeRef<N>
impl<N> !Send for NodeRef<N>
impl<N> !Sync for NodeRef<N>
impl<N> Unpin for NodeRef<N>where
N: Unpin,
impl<N> UnsafeUnpin for NodeRef<N>
impl<N> UnwindSafe for NodeRef<N>where
N: UnwindSafe,
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