pub enum Role {
Packages,
RepositoryMetadata,
Image,
Custom(CustomRole),
}
Expand description
Acts as a trust domain that is associated with a set of verifiers.
A Role
is always combined with a Mode
and in combination forms a Purpose
.
E.g. Role::Packages
combined with Mode::TrustAnchor
specify the purpose path
trust-anchor-packages
.
Variants§
Packages
Identifies verifiers used for verifying package signatures.
RepositoryMetadata
Identifies verifiers used for verifying package repository metadata signatures.
Image
Identifies verifiers used for verifying OS image signatures.
Custom(CustomRole)
Identifies verifiers used for verifying OS image signatures.
Implementations§
Source§impl Role
impl Role
Sourcepub fn parser(input: &mut &str) -> ModalResult<Self>
pub fn parser(input: &mut &str) -> ModalResult<Self>
Recognizes a Role
in a string slice.
Consumes all of its input
.
§Errors
Returns an error if none of the variants of Role
can be created from input
.
§Examples
use voa_core::identifiers::Role;
use winnow::Parser;
assert_eq!(Role::parser.parse("packages")?, Role::Packages);
assert_eq!(
Role::parser.parse("repository-metadata")?,
Role::RepositoryMetadata
);
assert_eq!(Role::parser.parse("image")?, Role::Image);
assert_eq!(
Role::parser.parse("custom")?,
Role::Custom("custom".parse()?)
);
Trait Implementations§
Source§impl From<CustomRole> for Role
impl From<CustomRole> for Role
Source§fn from(val: CustomRole) -> Self
fn from(val: CustomRole) -> Self
Converts to this type from the input type.
impl StructuralPartialEq for Role
Auto Trait Implementations§
impl Freeze for Role
impl RefUnwindSafe for Role
impl Send for Role
impl Sync for Role
impl Unpin for Role
impl UnwindSafe for Role
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