[−][src]Struct rpki::resources::AsResources
The AS Resources of an RPKI Certificate.
This type contains the ‘Autonomous System Identifier Delegation Extension’ as defined in [RFC 3779] in the restricted form specified in [RFC 6487].
This type contains the resources as represented in an RPKI certificate’s
AS resources extension. This extension provides two options: there can
be an actual set of AS numbers associated with the certificate – this is
the AsResources::Blocks
variant –, or the AS resources of the issuer can
be inherited – the AsResources::Inherit
variant.
Methods
impl AsResources
[src]
pub fn is_inherited(&self) -> bool
[src]
Returns whether the resources are of the inherited variant.
pub fn as_blocks(&self) -> Option<&AsBlocks>
[src]
Returns a reference to the blocks if there are any.
pub fn to_blocks(&self) -> Result<AsBlocks, ValidationError>
[src]
Converts the resources into blocks or returns an error.
impl AsResources
[src]
pub fn take_from<S: Source>(cons: &mut Constructed<S>) -> Result<Self, S::Err>
[src]
Takes the AS resources from the beginning of an encoded value.
The ASN.1 specification for the ASIdentifiers
types parsed here is
given in section 3.2.3 of RFC 3779 as follows:
ASIdentifiers ::= SEQUENCE {
asnum [0] EXPLICIT AsIdentifierChoice OPTIONAL,
rdi [1] EXPLICIT AsIdentifierChoice OPTIONAL }
AsIdentifierChoice ::= CHOICE {
inherit NULL,
asIdsOrRanges SEQUENCE OF ASIdOrRange }
ASIdOrRange ::= CHOICE {
id ASId,
range ASRange }
ASRange ::= SEQUENCE {
min ASId,
max ASId }
ASId ::= INTEGER
Section 4.8.11 of RFC 6487 limits the ASIdentifiers
to the
asnum
choice. If asIdsOrRanges
is chosen, it must include a
non-empty set of AS numbers.
This function implements these limitations. It maps the id
choice
of AsIdOrRange
to a range covering one number in order to keep
things simpler.
pub fn encode(self) -> impl Values
[src]
Trait Implementations
impl Clone for AsResources
[src]
fn clone(&self) -> AsResources
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for AsResources
[src]
Auto Trait Implementations
impl Send for AsResources
impl Sync for AsResources
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,