pub struct RtBuffer<T, P>(/* private fields */);
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>
impl<T, P> Size for RtBuffer<T, P>
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.
Auto Trait Implementations§
impl<T, P> Freeze for RtBuffer<T, P>
impl<T, P> RefUnwindSafe for RtBuffer<T, P>where
T: RefUnwindSafe,
P: RefUnwindSafe,
impl<T, P> Send for RtBuffer<T, P>
impl<T, P> Sync for RtBuffer<T, P>
impl<T, P> Unpin for RtBuffer<T, P>
impl<T, P> UnwindSafe for RtBuffer<T, P>where
T: UnwindSafe,
P: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more