Struct CnMsgBuilder

Source
pub struct CnMsgBuilder<P: Size> { /* private fields */ }
Expand description

Builder for CnMsg.

Implementations§

Source§

impl<P: Size> CnMsgBuilder<P>

Source

pub fn idx(self, value: CnMsgIdx) -> Self

Index of the connector (idx)

Source

pub fn val(self, value: CnMsgVal) -> Self

Value (val)

Source

pub fn seq(self, value: u32) -> Self

Sequence number

Source

pub fn ack(self, value: u32) -> Self

Acknowledgement number

Source

pub fn flags(self, value: u16) -> Self

Flags

Source

pub fn payload(self, value: P) -> Self

Payload of the netlink message

You can either use predefined types like ProcCnMcastOp or ProcEventHeader, a custom type defined by you or Vec<u8> for raw payload.

Source

pub fn build(self) -> Result<CnMsg<P>, CnMsgBuilderError>

Builds a new CnMsg.

§Errors

If a required field has not been initialized.

Trait Implementations§

Source§

impl<P: Size> Default for CnMsgBuilder<P>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<P> Freeze for CnMsgBuilder<P>
where P: Freeze,

§

impl<P> RefUnwindSafe for CnMsgBuilder<P>
where P: RefUnwindSafe,

§

impl<P> Send for CnMsgBuilder<P>
where P: Send,

§

impl<P> Sync for CnMsgBuilder<P>
where P: Sync,

§

impl<P> Unpin for CnMsgBuilder<P>
where P: Unpin,

§

impl<P> UnwindSafe for CnMsgBuilder<P>
where P: UnwindSafe,

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.