[][src]Enum rpki::resources::ResourcesChoice

pub enum ResourcesChoice<T> {
    Inherit,
    Blocks(T),
}

The option to either include or inherit resources.

This is generic over the type of included resources.

Variants

Inherit

Resources are to be inherited from the issuer.

Blocks(T)

The resources are provided as a set of blocks.

Methods

impl<T> ResourcesChoice<T>[src]

pub fn is_inherited(&self) -> bool[src]

Returns whether the resources are of the inherited variant.

pub fn as_blocks(&self) -> Option<&T>[src]

Returns a reference to the blocks if there are any.

pub fn as_blocks_mut(&mut self) -> Option<&mut T>[src]

Returns a mutable reference to the blocks if there are any.

pub fn to_blocks(&self) -> Result<T, ValidationError> where
    T: Clone
[src]

Converts the resources into blocks or returns an error.

pub fn map_blocks<U, F>(self, f: F) -> ResourcesChoice<U> where
    F: FnOnce(T) -> U, 
[src]

Converts the choice into a different choice via a closure.

If this value is of the included variant, runs the blocks through the provided closure and returns a new choice with the result. If this value is of the inherit variant, does nothing and simply returns the choice.

Trait Implementations

impl<T: Eq> Eq for ResourcesChoice<T>[src]

impl<T: PartialEq> PartialEq<ResourcesChoice<T>> for ResourcesChoice<T>[src]

impl<T: Clone> Clone for ResourcesChoice<T>[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<T: Debug> Debug for ResourcesChoice<T>[src]

impl<T: Display> Display for ResourcesChoice<T>[src]

impl<T: FromStr> FromStr for ResourcesChoice<T>[src]

type Err = FromStrErr

The associated error which can be returned from parsing.

impl<T> Serialize for ResourcesChoice<T> where
    T: Serialize
[src]

impl<'de, T> Deserialize<'de> for ResourcesChoice<T> where
    T: Deserialize<'de>, 
[src]

Auto Trait Implementations

impl<T> Send for ResourcesChoice<T> where
    T: Send

impl<T> Sync for ResourcesChoice<T> where
    T: Sync

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]