Struct netlink_packet_route::NetlinkMessage [−][src]
pub struct NetlinkMessage<I> {
pub header: NetlinkHeader,
pub payload: NetlinkPayload<I>,
}
Expand description
Represent a netlink message.
Fields
header: NetlinkHeader
Message header (this is common to all the netlink protocols)
payload: NetlinkPayload<I>
Inner message, which depends on the netlink protocol being used.
Implementations
Create a new netlink message from the given header and payload
Consume this message and return its header and payload
Parse the given buffer as a netlink message
Return the length of this message in bytes
Serialize this message and write the serialized data into the
given buffer. buffer
must big large enough for the whole
message to fit, otherwise, this method will panic. To know how
big the serialized message is, call buffer_len()
.
Panic
This method panics if the buffer is not big enough.
Ensure the header (NetlinkHeader
) is consistent with the payload (NetlinkPayload
):
- compute the payload length and set the header’s length field
- check the payload type and set the header’s message type field accordingly
If you are not 100% sure the header is correct, this method should be called before calling
Emitable::emit()
, as it could panic if the header is
inconsistent with the rest of the message.
Trait Implementations
Performs the conversion.
impl<'buffer, B, I> Parseable<NetlinkBuffer<&'buffer B>> for NetlinkMessage<I> where
B: 'buffer + AsRef<[u8]>,
I: NetlinkDeserializable,
impl<'buffer, B, I> Parseable<NetlinkBuffer<&'buffer B>> for NetlinkMessage<I> where
B: 'buffer + AsRef<[u8]>,
I: NetlinkDeserializable,
Deserialize the current type.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl<I> RefUnwindSafe for NetlinkMessage<I> where
I: RefUnwindSafe,
impl<I> Send for NetlinkMessage<I> where
I: Send,
impl<I> Sync for NetlinkMessage<I> where
I: Sync,
impl<I> Unpin for NetlinkMessage<I> where
I: Unpin,
impl<I> UnwindSafe for NetlinkMessage<I> where
I: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more