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
Creates an ASN with a value of 0. This is equivalent to Asn::RESERVED.
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 PartialOrd for Asn
impl PartialOrd for Asn
impl Copy for Asn
impl Eq for Asn
Auto Trait Implementations§
impl Freeze for Asn
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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.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 moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.