pub enum Role {
Root,
Snapshot,
Targets,
Timestamp,
}Expand description
The TUF role.
Variants§
Root
The root role.
Snapshot
The snapshot role.
Targets
The targets role.
Timestamp
The timestamp role.
Implementations§
Source§impl Role
impl Role
Sourcepub fn fuzzy_matches_path(&self, path: &MetadataPath) -> bool
pub fn fuzzy_matches_path(&self, path: &MetadataPath) -> bool
Check if this role could be associated with a given path.
use tuf::metadata::{MetadataPath, Role};
assert!(Role::Root.fuzzy_matches_path(&MetadataPath::root()));
assert!(Role::Snapshot.fuzzy_matches_path(&MetadataPath::snapshot()));
assert!(Role::Targets.fuzzy_matches_path(&MetadataPath::targets()));
assert!(Role::Timestamp.fuzzy_matches_path(&MetadataPath::timestamp()));
assert!(!Role::Root.fuzzy_matches_path(&MetadataPath::snapshot()));
assert!(!Role::Root.fuzzy_matches_path(&MetadataPath::new("wat").unwrap()));Trait Implementations§
Source§impl<'de> Deserialize<'de> for Role
impl<'de> Deserialize<'de> for Role
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<Role> for MetadataPath
impl From<Role> for MetadataPath
Source§fn from(role: Role) -> MetadataPath
fn from(role: Role) -> MetadataPath
Converts to this type from the input type.
impl Eq for Role
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 UnsafeUnpin 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