[−][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: Eq> Eq for ResourcesChoice<T>
[src]
impl<T: PartialEq> PartialEq<ResourcesChoice<T>> for ResourcesChoice<T>
[src]
fn eq(&self, other: &ResourcesChoice<T>) -> bool
[src]
fn ne(&self, other: &ResourcesChoice<T>) -> bool
[src]
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]
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.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl<T> Serialize for ResourcesChoice<T> where
T: Serialize,
[src]
T: Serialize,
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de, T> Deserialize<'de> for ResourcesChoice<T> where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
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> 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, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> From<T> for T
[src]
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> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
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>,