[][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: 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]

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, U> Into for T where
    U: From<T>, 
[src]

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

type Owned = T

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

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

The type returned in the event of a conversion error.