pub struct RtBuffer<T, P>(_);
Expand description
A buffer of rtnetlink attributes.
Implementations§
source§impl<T> RtBuffer<T, Buffer>
impl<T> RtBuffer<T, Buffer>
sourcepub fn get_attr_handle(&self) -> AttrHandle<'_, Self, Rtattr<T, Buffer>>
pub fn get_attr_handle(&self) -> AttrHandle<'_, Self, Rtattr<T, Buffer>>
Get a data structure with an immutable reference to the
underlying Rtattr
s.
sourcepub fn get_attr_handle_mut(
&mut self
) -> AttrHandleMut<'_, Self, Rtattr<T, Buffer>>
pub fn get_attr_handle_mut(
&mut self
) -> AttrHandleMut<'_, Self, Rtattr<T, Buffer>>
Get a data structure with a mutable reference to the
underlying Rtattr
s.
source§impl<T, P> RtBuffer<T, P>
impl<T, P> RtBuffer<T, P>
sourcepub fn push(&mut self, attr: Rtattr<T, P>)
pub fn push(&mut self, attr: Rtattr<T, P>)
Add a new routing netlink attribute to the end of the buffer.
sourcepub fn pop(&mut self) -> Option<Rtattr<T, P>>
pub fn pop(&mut self) -> Option<Rtattr<T, P>>
Get a routing netlink attribute from the end of the buffer.
sourcepub fn iter(&self) -> Iter<'_, Rtattr<T, P>>
pub fn iter(&self) -> Iter<'_, Rtattr<T, P>>
Return an iterator over immutable references to the elements in the buffer.
Trait Implementations§
source§impl<'lifetime, T: RtaType, P: FromBytesWithInput<'lifetime, Input = usize>> FromBytesWithInput<'lifetime> for RtBuffer<T, P>
impl<'lifetime, T: RtaType, P: FromBytesWithInput<'lifetime, Input = usize>> FromBytesWithInput<'lifetime> for RtBuffer<T, P>
source§impl<T, P> FromIterator<Rtattr<T, P>> for RtBuffer<T, P>
impl<T, P> FromIterator<Rtattr<T, P>> for RtBuffer<T, P>
source§impl<T, P> IntoIterator for RtBuffer<T, P>
impl<T, P> IntoIterator for RtBuffer<T, P>
source§impl<T, P> Size for RtBuffer<T, P>where
T: Size,
P: Size,
impl<T, P> Size for RtBuffer<T, P>where
T: Size,
P: Size,
source§fn unpadded_size(&self) -> usize
fn unpadded_size(&self) -> usize
Size of the unpadded data structure. This will usually
only be unaligned for variable length types like
strings or byte buffers.
source§fn padded_size(&self) -> usize
fn padded_size(&self) -> usize
Get the size of of the payload and align it to
the required netlink byte alignment.