Struct bgpkit_parser::models::Asn
source · pub struct Asn { /* private fields */ }
Expand description
ASN – Autonomous System Number
Implementations§
source§impl Asn
impl Asn
pub const RESERVED: Self = _
pub const TRANSITION: Self = _
sourcepub const fn required_len(&self) -> AsnLength
pub const fn required_len(&self) -> AsnLength
Gets the size required to store this ASN
sourcepub const fn is_private(&self) -> bool
pub const fn is_private(&self) -> bool
Checks if the given ASN is reserved for private use.
sourcepub const fn is_reserved(&self) -> bool
pub const fn is_reserved(&self) -> bool
Checks if the given ASN is reserved. This is done by checking if the asn is included within IANA’s “Special-Purpose AS Numbers” registry. This includes checking against private ASN ranges, ASNs reserved for documentation, and ASNs reserved for specific uses by various RFCs.
Up to date as of 2023-03-01 (Registry was last updated 2015-08-07).
For additional details see:
sourcepub const fn is_reserved_for_documentation(&self) -> bool
pub const fn is_reserved_for_documentation(&self) -> bool
Checks if the given ASN is reserved for use in documentation and sample code.
sourcepub const fn is_four_byte(&self) -> bool
pub const fn is_four_byte(&self) -> bool
Return if an ASN is 4 bytes or not.
Trait Implementations§
source§impl Default for Asn
impl Default for Asn
Creates an ASN with a value of 0. This is equivalent to Asn::RESERVED.
source§impl Ord for Asn
impl Ord for Asn
source§impl PartialEq for Asn
impl PartialEq for Asn
source§impl PartialOrd for Asn
impl PartialOrd for Asn
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Asn
impl Eq for Asn
Auto Trait Implementations§
impl RefUnwindSafe for Asn
impl Send for Asn
impl Sync for Asn
impl Unpin for Asn
impl UnwindSafe for Asn
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.