[−][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 inherit() -> Self
[src]
Creates a new AsResources with a ResourcesChoice::Inherit
pub fn blocks(blocks: AsBlocks) -> Self
[src]
Creates a new AsResources for the given blocks.
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]
pub fn encode_ref<'a>(&'a self) -> impl Values + 'a
[src]
Trait Implementations
impl Clone for AsResources
[src]
fn clone(&self) -> AsResources
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Eq for AsResources
[src]
impl PartialEq<AsResources> for AsResources
[src]
fn eq(&self, other: &AsResources) -> bool
[src]
fn ne(&self, other: &AsResources) -> bool
[src]
impl Display for AsResources
[src]
impl Debug for AsResources
[src]
impl FromStr for AsResources
[src]
type Err = FromStrError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl StructuralPartialEq for AsResources
[src]
impl StructuralEq for AsResources
[src]
impl Serialize for AsResources
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de> Deserialize<'de> for AsResources
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl Send for AsResources
impl Sync for AsResources
impl Unpin for AsResources
impl UnwindSafe for AsResources
impl RefUnwindSafe for AsResources
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> 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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,