Skip to main content

NextNodes

Trait NextNodes 

Source
pub unsafe trait NextNodes {
    type CNamesArray: AsRef<[*mut c_char]>;

    const C_NAMES: Self::CNamesArray;

    // Required method
    fn into_u16(self) -> u16;
}
Expand description

Trait for defining next nodes of a VPP node

Typically this trait is implemented automatically using the vpp_plugin_macros::NextNodes derive macro.

§Safety

  • The length of C_NAMES must be greater than the maximum value that into_u16 can return (i.e. if implemented for an enum, it should match number of discriminators, and there are no gaps in the discriminator values).
  • Each pointer in C_NAMES must be a valid, nul-terminated string and must stay valid for the duration of that any nodes using this NextNodes implementation are registered.

Required Associated Constants§

Source

const C_NAMES: Self::CNamesArray

Array of C names of the next nodes indexed by Self::into_u16

Required Associated Types§

Required Methods§

Source

fn into_u16(self) -> u16

The u16 value of this next node

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§