FromBpfValue

Trait FromBpfValue 

Source
pub trait FromBpfValue<C>: Sized {
    // Required method
    unsafe fn from_bpf_value(context: &mut C, v: BpfValue) -> Self;
}
Expand description

Trait that should be implemented for types that can be converted from BpfValue. Used to get a Packet when loading a value from the packet.

Required Methods§

Source

unsafe fn from_bpf_value(context: &mut C, v: BpfValue) -> Self

§Safety

Should be called only by the eBPF interpreter when executing verified eBPF code.

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.

Implementations on Foreign Types§

Source§

impl<'a, T, C> FromBpfValue<C> for &'a T

Source§

unsafe fn from_bpf_value(_context: &mut C, v: BpfValue) -> Self

Source§

impl<'a, T, C> FromBpfValue<C> for &'a mut T

Source§

unsafe fn from_bpf_value(_context: &mut C, v: BpfValue) -> Self

Source§

impl<C> FromBpfValue<C> for ()

Source§

unsafe fn from_bpf_value(_context: &mut C, _v: BpfValue) -> Self

Implementors§