pub struct CommunitiesView<'a> { /* private fields */ }Expand description
Borrowed view over an element’s BGP community attributes (COMMUNITIES,
EXTENDED_COMMUNITIES, IPV6_ADDRESS_SPECIFIC_EXTENDED_COMMUNITIES, and
LARGE_COMMUNITIES).
Note on wire layout: BGP attributes in MRT bodies sit at arbitrary 1-byte alignments, store
integers in network byte order (big-endian), and split plain, extended, and large communities
across distinct TLV attributes. Consequently, a native &[u32] slice cannot borrow the wire
bytes directly on little-endian hosts without copying. Instead, CommunitiesView borrows the
attribute bytes directly and exposes a zero-allocation iter that decodes each
community in place.
Implementations§
Source§impl<'a> CommunitiesView<'a>
impl<'a> CommunitiesView<'a>
Sourcepub fn iter(&self) -> CommunitiesIter<'a> ⓘ
pub fn iter(&self) -> CommunitiesIter<'a> ⓘ
Iterates over all MetaCommunity values in wire attribute order, matching
BgpElem::communities.
Trait Implementations§
Source§impl<'a> Clone for CommunitiesView<'a>
impl<'a> Clone for CommunitiesView<'a>
impl<'a> Copy for CommunitiesView<'a>
Source§impl<'a> Debug for CommunitiesView<'a>
impl<'a> Debug for CommunitiesView<'a>
Source§impl<'a> IntoIterator for CommunitiesView<'a>
impl<'a> IntoIterator for CommunitiesView<'a>
Source§impl<'a> IntoIterator for &CommunitiesView<'a>
impl<'a> IntoIterator for &CommunitiesView<'a>
Auto Trait Implementations§
impl<'a> Forget for CommunitiesView<'a>
impl<'a> Freeze for CommunitiesView<'a>
impl<'a> Move for CommunitiesView<'a>
impl<'a> RefUnwindSafe for CommunitiesView<'a>
impl<'a> Send for CommunitiesView<'a>
impl<'a> Sync for CommunitiesView<'a>
impl<'a> Unpin for CommunitiesView<'a>
impl<'a> UnsafeUnpin for CommunitiesView<'a>where
&'a [u8]: UnsafeUnpin,
impl<'a> UnwindSafe for CommunitiesView<'a>where
&'a [u8]: 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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