pub struct RecordElems<'a> { /* private fields */ }Expand description
A borrowed batch of elements from one MRT record.
Holds a mutable borrow of the BgpkitParser (its reusable record buffer, and the active peer
table for a dump); drop it before advancing the parser to the next record.
Implementations§
Source§impl<'a> RecordElems<'a>
impl<'a> RecordElems<'a>
Sourcepub fn header(&self) -> &CommonHeader
pub fn header(&self) -> &CommonHeader
Returns the MRT CommonHeader of this record.
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
The number of entries the record declares: the RIB entry count, or the number of NLRI this update announced and withdrew.
This is what the header says, not a promise about how many elements the iterator yields: an entry naming a peer outside the table, or one the record cannot decode, produces fewer. Never size a buffer from it without a ceiling, since the count comes from the input.
Sourcepub fn iter(&self) -> ElemRefIter<'a> ⓘ
pub fn iter(&self) -> ElemRefIter<'a> ⓘ
Returns an iterator yielding borrowed ElemRef views over the record’s elements.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Forget for RecordElems<'a>
impl<'a> Freeze for RecordElems<'a>
impl<'a> Move for RecordElems<'a>
impl<'a> RefUnwindSafe for RecordElems<'a>where
InternalBitFlags: RefUnwindSafe,
impl<'a> Send for RecordElems<'a>
impl<'a> Sync for RecordElems<'a>where
InternalBitFlags: Sync,
impl<'a> Unpin for RecordElems<'a>
impl<'a> UnsafeUnpin for RecordElems<'a>
impl<'a> UnwindSafe for RecordElems<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more