Skip to main content

NodeRuntimeRef

Struct NodeRuntimeRef 

Source
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>

Source

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_data field must be set correctly to point to a valid RuntimeData instance.
  • The node_index field must be set correctly to point to a valid node in the VPP node main.
Source

pub fn as_ptr(&self) -> *mut vlib_node_runtime_t

Returns the raw pointer to the underlying vlib_node_runtime_t

Source

pub fn runtime_data(&self) -> &N::RuntimeData

Returns the node-defined runtime data of the node

Source

pub fn runtime_data_mut(&mut self) -> &mut N::RuntimeData

Returns the node-defined runtime data of the node as mutable

Source

pub fn node(&self, vm: &MainRef) -> &NodeRef<N>

Returns the associated node reference

Source

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.

Source

pub fn flags(&self) -> NodeFlags

Node flags

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>
where N: Unpin + ?Sized,

§

impl<N> UnsafeUnpin for NodeRuntimeRef<N>
where N: ?Sized,

§

impl<N> UnwindSafe for NodeRuntimeRef<N>
where N: UnwindSafe + ?Sized,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.