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 add_validation_warning(&mut self, warning: BgpValidationWarning)
pub fn add_validation_warning(&mut self, warning: BgpValidationWarning)
Add a validation warning to the attributes
Sourcepub fn validation_warnings(&self) -> &[BgpValidationWarning]
pub fn validation_warnings(&self) -> &[BgpValidationWarning]
Get all validation warnings for these attributes
Sourcepub fn has_validation_warnings(&self) -> bool
pub fn has_validation_warnings(&self) -> bool
Check if there are any validation warnings
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
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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
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)
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)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)
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)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
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
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
key and return true if they are equal.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>
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>
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