pub struct NodeRuntimeRef<N: Node + ?Sized>(/* private fields */);Expand description
Reference to a VPP node runtime data
This is a per-node-instance, per-thread structure containing runtime data about the node.
A &mut NodeRuntimeRef corresponds to vlib_node_runtime_t * in C.
Implementations§
Source§impl<N: Node> NodeRuntimeRef<N>
impl<N: Node> NodeRuntimeRef<N>
Sourcepub unsafe fn from_ptr_mut<'a>(ptr: *mut vlib_node_runtime_t) -> &'a mut Self
pub unsafe fn from_ptr_mut<'a>(ptr: *mut vlib_node_runtime_t) -> &'a mut Self
Creates a &mut NodeRuntimeRef directly from a pointer
§Safety
- The pointer must be valid and a properly initialised
vlib_node_runtime_t. - The pointer must stay valid and the contents must not be mutated for the duration of the lifetime of the returned reference.
- The
runtime_datafield must be set correctly to point to a validRuntimeDatainstance. - The
node_indexfield must be set correctly to point to a valid node in the VPP node main.
Sourcepub fn as_ptr(&self) -> *mut vlib_node_runtime_t
pub fn as_ptr(&self) -> *mut vlib_node_runtime_t
Returns the raw pointer to the underlying vlib_node_runtime_t
Sourcepub fn runtime_data(&self) -> &N::RuntimeData
pub fn runtime_data(&self) -> &N::RuntimeData
Returns the node-defined runtime data of the node
Sourcepub fn runtime_data_mut(&mut self) -> &mut N::RuntimeData
pub fn runtime_data_mut(&mut self) -> &mut N::RuntimeData
Returns the node-defined runtime data of the node as mutable
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
See also NodeRef::increment_error_counter.
Auto Trait Implementations§
impl<N> Freeze for NodeRuntimeRef<N>where
N: ?Sized,
impl<N> !RefUnwindSafe for NodeRuntimeRef<N>
impl<N> !Send for NodeRuntimeRef<N>
impl<N> !Sync for NodeRuntimeRef<N>
impl<N> Unpin for NodeRuntimeRef<N>
impl<N> UnsafeUnpin for NodeRuntimeRef<N>where
N: ?Sized,
impl<N> UnwindSafe for NodeRuntimeRef<N>where
N: UnwindSafe + ?Sized,
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