Struct bgpkit_parser::models::Attributes
source · pub struct Attributes { /* private fields */ }
Expand description
Convenience wrapper for a list of attributes
Implementations§
source§impl Attributes
impl Attributes
pub fn has_attr(&self, ty: AttrType) -> bool
pub fn get_attr(&self, ty: AttrType) -> Option<Attribute>
pub fn add_attr(&mut self, attr: Attribute)
sourcepub fn origin(&self) -> Origin
pub fn origin(&self) -> Origin
Get the ORIGIN
attribute. In the event that this attribute is not present,
Origin::INCOMPLETE will be returned instead.
sourcepub fn origin_id(&self) -> Option<BgpIdentifier>
pub fn origin_id(&self) -> Option<BgpIdentifier>
Get the ORIGINATOR_ID
attribute if present.
sourcepub fn next_hop(&self) -> Option<IpAddr>
pub fn next_hop(&self) -> Option<IpAddr>
Get the NEXT_HOP
attribute if present.
Note: Even when this attribute is not present, the next hop address may still be attainable from the
MP_REACH_NLRI
attribute.
pub fn multi_exit_discriminator(&self) -> Option<u32>
pub fn local_preference(&self) -> Option<u32>
pub fn only_to_customer(&self) -> Option<Asn>
pub fn atomic_aggregate(&self) -> bool
pub fn aggregator(&self) -> Option<(Asn, BgpIdentifier)>
pub fn clusters(&self) -> Option<&[u32]>
pub fn as_path(&self) -> Option<&AsPath>
pub fn get_reachable_nlri(&self) -> Option<&Nlri>
pub fn get_unreachable_nlri(&self) -> Option<&Nlri>
pub fn iter_communities(&self) -> MetaCommunitiesIter<'_> ⓘ
sourcepub fn iter(&self) -> <&Self as IntoIterator>::IntoIter
pub fn iter(&self) -> <&Self as IntoIterator>::IntoIter
Get an iterator over the held AttributeValues. If you also need attribute flags, consider using Attributes::into_attributes_iter instead.
sourcepub fn into_attributes_iter(self) -> impl Iterator<Item = Attribute>
pub fn into_attributes_iter(self) -> impl Iterator<Item = Attribute>
Get an iterator over the held Attributes. If you do no not need attribute flags, consider using Attributes::iter instead.
Trait Implementations§
source§impl Clone for Attributes
impl Clone for Attributes
source§fn clone(&self) -> Attributes
fn clone(&self) -> Attributes
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Attributes
impl Debug for Attributes
source§impl Default for Attributes
impl Default for Attributes
source§fn default() -> Attributes
fn default() -> Attributes
Returns the “default value” for a type. Read more
source§impl Extend<Attribute> for Attributes
impl Extend<Attribute> for Attributes
source§fn extend<T: IntoIterator<Item = Attribute>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = Attribute>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
source§impl Extend<AttributeValue> for Attributes
impl Extend<AttributeValue> for Attributes
source§fn extend<T: IntoIterator<Item = AttributeValue>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = AttributeValue>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
source§impl From<&BgpElem> for Attributes
impl From<&BgpElem> for Attributes
source§impl FromIterator<Attribute> for Attributes
impl FromIterator<Attribute> for Attributes
source§impl FromIterator<AttributeValue> for Attributes
impl FromIterator<AttributeValue> for Attributes
source§fn from_iter<T: IntoIterator<Item = AttributeValue>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = AttributeValue>>(iter: T) -> Self
Creates a value from an iterator. Read more
source§impl<'a> IntoIterator for &'a Attributes
impl<'a> IntoIterator for &'a Attributes
source§impl IntoIterator for Attributes
impl IntoIterator for Attributes
source§impl PartialEq for Attributes
impl PartialEq for Attributes
source§fn eq(&self, other: &Attributes) -> bool
fn eq(&self, other: &Attributes) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for Attributes
impl StructuralPartialEq for Attributes
Auto Trait Implementations§
impl Freeze for Attributes
impl RefUnwindSafe for Attributes
impl Send for Attributes
impl Sync for Attributes
impl Unpin for Attributes
impl UnwindSafe for Attributes
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
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.