pub enum Context {
Default,
Custom(CustomContext),
}Expand description
A context within a [Purpose] for more fine-grained verifier
assignments.
An example for context is the name of a specific software repository when certificates are used in the context of the packages purpose (e.g. “core”).
If no specific context is required, Context::Default must be used.
Variants§
Default
The default context.
Custom(CustomContext)
Defines a custom Context for verifiers within an [Os] and
[Purpose].
Implementations§
Source§impl Context
impl Context
Sourcepub fn parser(input: &mut &str) -> Result<Context, ErrMode<ContextError>>
pub fn parser(input: &mut &str) -> Result<Context, ErrMode<ContextError>>
Recognizes a Context in a string slice.
Consumes all of its input.
§Errors
Returns an error if
inputdoes not contain a variant ofContext,- or one of the characters in
inputis not covered byIdentifierString::valid_chars.
§Examples
use voa_core::identifiers::{Context, CustomContext};
use winnow::Parser;
assert_eq!(Context::parser.parse("default")?, Context::Default);
assert_eq!(
Context::parser.parse("test")?,
Context::Custom(CustomContext::new("test".parse()?))
);Trait Implementations§
Source§impl<'de> Deserialize<'de> for Context
impl<'de> Deserialize<'de> for Context
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Context, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Context, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<Context> for ConfigContext
impl From<Context> for ConfigContext
Source§impl From<CustomContext> for Context
impl From<CustomContext> for Context
Source§fn from(val: CustomContext) -> Context
fn from(val: CustomContext) -> Context
Converts to this type from the input type.
Source§impl Ord for Context
impl Ord for Context
Source§impl PartialOrd for Context
impl PartialOrd for Context
Source§impl Serialize for Context
impl Serialize for Context
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for Context
impl StructuralPartialEq for Context
Auto Trait Implementations§
impl Freeze for Context
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of [
ToCompactString::to_compact_string()] Read more§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a [
CompactString]. Read more