[−][src]Enum rpki::resources::ResourcesChoice
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]
T: Clone,
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]
F: FnOnce(T) -> U,
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(&self) -> 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,
T: Send,
impl<T> Sync for ResourcesChoice<T> where
T: Sync,
T: Sync,
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>,