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§
Sourceconst C_NAMES: Self::CNamesArray
const C_NAMES: Self::CNamesArray
Array of C names of the next nodes indexed by Self::into_u16
Required Associated Types§
Sourcetype CNamesArray: AsRef<[*mut c_char]>
type CNamesArray: AsRef<[*mut c_char]>
Array type for Self::C_NAMES
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.