Trait ToBytes

Source
pub trait ToBytes: Debug {
    // Required method
    fn to_bytes(&self, buffer: &mut Cursor<Vec<u8>>) -> Result<(), SerError>;

    // Provided method
    fn pad(&self, buffer: &mut Cursor<Vec<u8>>) -> Result<(), SerError> { ... }
}
Expand description

A trait defining a netlink data structure’s conversion to a byte buffer.

Required Methods§

Source

fn to_bytes(&self, buffer: &mut Cursor<Vec<u8>>) -> Result<(), SerError>

Takes a byte buffer and serializes the data structure into it.

Provided Methods§

Source

fn pad(&self, buffer: &mut Cursor<Vec<u8>>) -> Result<(), SerError>

Pad a netlink message to the appropriate alignment.

Implementations on Foreign Types§

Source§

impl ToBytes for &str

Source§

fn to_bytes(&self, buffer: &mut Cursor<Vec<u8>>) -> Result<(), SerError>

Source§

impl ToBytes for &[u8]

Source§

fn to_bytes(&self, buffer: &mut Cursor<Vec<u8>>) -> Result<(), SerError>

Source§

impl ToBytes for f32

Source§

fn to_bytes(&self, buffer: &mut Cursor<Vec<u8>>) -> Result<(), SerError>

Source§

impl ToBytes for f64

Source§

fn to_bytes(&self, buffer: &mut Cursor<Vec<u8>>) -> Result<(), SerError>

Source§

impl ToBytes for i8

Source§

fn to_bytes(&self, buffer: &mut Cursor<Vec<u8>>) -> Result<(), SerError>

Source§

impl ToBytes for i16

Source§

fn to_bytes(&self, buffer: &mut Cursor<Vec<u8>>) -> Result<(), SerError>

Source§

impl ToBytes for i32

Source§

fn to_bytes(&self, buffer: &mut Cursor<Vec<u8>>) -> Result<(), SerError>

Source§

impl ToBytes for i64

Source§

fn to_bytes(&self, buffer: &mut Cursor<Vec<u8>>) -> Result<(), SerError>

Source§

impl ToBytes for i128

Source§

fn to_bytes(&self, buffer: &mut Cursor<Vec<u8>>) -> Result<(), SerError>

Source§

impl ToBytes for u8

Source§

fn to_bytes(&self, buffer: &mut Cursor<Vec<u8>>) -> Result<(), SerError>

Source§

impl ToBytes for u16

Source§

fn to_bytes(&self, buffer: &mut Cursor<Vec<u8>>) -> Result<(), SerError>

Source§

impl ToBytes for u32

Source§

fn to_bytes(&self, buffer: &mut Cursor<Vec<u8>>) -> Result<(), SerError>

Source§

impl ToBytes for u64

Source§

fn to_bytes(&self, buffer: &mut Cursor<Vec<u8>>) -> Result<(), SerError>

Source§

impl ToBytes for u128

Source§

fn to_bytes(&self, buffer: &mut Cursor<Vec<u8>>) -> Result<(), SerError>

Source§

impl ToBytes for ()

Source§

fn to_bytes(&self, _: &mut Cursor<Vec<u8>>) -> Result<(), SerError>

Source§

impl ToBytes for String

Source§

fn to_bytes(&self, buffer: &mut Cursor<Vec<u8>>) -> Result<(), SerError>

Source§

impl<T> ToBytes for Vec<T>
where T: ToBytes,

Source§

fn to_bytes(&self, buffer: &mut Cursor<Vec<u8>>) -> Result<(), SerError>

Source§

impl<T> ToBytes for PhantomData<T>

Source§

fn to_bytes(&self, _: &mut Cursor<Vec<u8>>) -> Result<(), SerError>

Implementors§

Source§

impl ToBytes for CtrlAttr

Source§

impl ToBytes for CtrlAttrMcastGrp

Source§

impl ToBytes for CtrlCmd

Source§

impl ToBytes for NlAttrTypeWrapper

Source§

impl ToBytes for LogCfgCmdWrapper

Source§

impl ToBytes for LogCmd

Source§

impl ToBytes for LogCopyMode

Source§

impl ToBytes for NetfilterMsg

Source§

impl ToBytes for NfLogAttr

Source§

impl ToBytes for NfLogCfg

Source§

impl ToBytes for GenlId

Source§

impl ToBytes for NlTypeWrapper

Source§

impl ToBytes for NlmF

Source§

impl ToBytes for Nlmsg

Source§

impl ToBytes for Af

Source§

impl ToBytes for Arphrd

Source§

impl ToBytes for Ifa

Source§

impl ToBytes for IfaF

Source§

impl ToBytes for Iff

Source§

impl ToBytes for Ifla

Source§

impl ToBytes for IflaInfo

Source§

impl ToBytes for Nda

Source§

impl ToBytes for Ntf

Source§

impl ToBytes for Nud

Source§

impl ToBytes for RtAddrFamily

Source§

impl ToBytes for RtScope

Source§

impl ToBytes for RtTable

Source§

impl ToBytes for Rta

Source§

impl ToBytes for RtaTypeWrapper

Source§

impl ToBytes for Rtm

Source§

impl ToBytes for RtmF

Source§

impl ToBytes for Rtn

Source§

impl ToBytes for Rtprot

Source§

impl ToBytes for Tca

Source§

impl ToBytes for AddrFamily

Source§

impl ToBytes for NlFamily

Source§

impl ToBytes for Index

Source§

impl ToBytes for NlmFFlags

Source§

impl ToBytes for IfaFFlags

Source§

impl ToBytes for IffFlags

Source§

impl ToBytes for NtfFlags

Source§

impl ToBytes for NudFlags

Source§

impl ToBytes for RtmFFlags

Source§

impl ToBytes for NoUserHeader

Source§

impl ToBytes for Ifaddrmsg

Source§

impl ToBytes for Ifinfomsg

Source§

impl ToBytes for NdaCacheinfo

Source§

impl ToBytes for Ndmsg

Source§

impl ToBytes for Rtgenmsg

Source§

impl ToBytes for Rtmsg

Source§

impl ToBytes for Tcmsg

Source§

impl ToBytes for BeU64

Source§

impl ToBytes for Buffer

Source§

impl<B: ToBytes, T: ToBytes> ToBytes for FlagBuffer<B, T>

Source§

impl<C: Cmd, T: NlAttrType, H: ToBytes> ToBytes for Genlmsghdr<C, T, H>

Source§

impl<T> ToBytes for AttrType<T>
where T: NlAttrType,

Source§

impl<T: NlAttrType, P: ToBytes> ToBytes for Nlattr<T, P>

Source§

impl<T: NlAttrType, P: ToBytes> ToBytes for GenlBuffer<T, P>

Source§

impl<T: ToBytes, P: ToBytes> ToBytes for NlPayload<T, P>

Source§

impl<T: ToBytes, P: ToBytes> ToBytes for Nlmsgerr<T, P>

Source§

impl<T: ToBytes, P: ToBytes> ToBytes for NlmsghdrErr<T, P>

Source§

impl<T: ToBytes, P: ToBytes> ToBytes for Nlmsghdr<T, P>

Source§

impl<T: ToBytes, P: ToBytes> ToBytes for Rtattr<T, P>

Source§

impl<T: ToBytes, P: ToBytes> ToBytes for NlBuffer<T, P>

Source§

impl<T: ToBytes, P: ToBytes> ToBytes for RtBuffer<T, P>