pub struct RootMetadata { /* private fields */ }Expand description
Metadata for the root role.
Implementations§
Source§impl RootMetadata
impl RootMetadata
Sourcepub fn new(
version: u32,
expires: DateTime<Utc>,
consistent_snapshot: bool,
keys: HashMap<KeyId, PublicKey>,
root: RoleDefinition<RootMetadata>,
snapshot: RoleDefinition<SnapshotMetadata>,
targets: RoleDefinition<TargetsMetadata>,
timestamp: RoleDefinition<TimestampMetadata>,
additional_fields: HashMap<String, Value>,
) -> Result<Self>
pub fn new( version: u32, expires: DateTime<Utc>, consistent_snapshot: bool, keys: HashMap<KeyId, PublicKey>, root: RoleDefinition<RootMetadata>, snapshot: RoleDefinition<SnapshotMetadata>, targets: RoleDefinition<TargetsMetadata>, timestamp: RoleDefinition<TimestampMetadata>, additional_fields: HashMap<String, Value>, ) -> Result<Self>
Create new RootMetadata.
Sourcepub fn consistent_snapshot(&self) -> bool
pub fn consistent_snapshot(&self) -> bool
Whether or not this repository is currently implementing that TUF consistent snapshot feature.
Sourcepub fn keys(&self) -> &HashMap<KeyId, PublicKey>
pub fn keys(&self) -> &HashMap<KeyId, PublicKey>
An immutable reference to the map of trusted keys.
Sourcepub fn root_keys(&self) -> impl Iterator<Item = &PublicKey>
pub fn root_keys(&self) -> impl Iterator<Item = &PublicKey>
An iterator over all the trusted root public keys.
Sourcepub fn targets_keys(&self) -> impl Iterator<Item = &PublicKey>
pub fn targets_keys(&self) -> impl Iterator<Item = &PublicKey>
An iterator over all the trusted targets public keys.
Sourcepub fn snapshot_keys(&self) -> impl Iterator<Item = &PublicKey>
pub fn snapshot_keys(&self) -> impl Iterator<Item = &PublicKey>
An iterator over all the trusted snapshot public keys.
Sourcepub fn timestamp_keys(&self) -> impl Iterator<Item = &PublicKey>
pub fn timestamp_keys(&self) -> impl Iterator<Item = &PublicKey>
An iterator over all the trusted timestamp public keys.
Sourcepub fn root(&self) -> &RoleDefinition<RootMetadata>
pub fn root(&self) -> &RoleDefinition<RootMetadata>
An immutable reference to the root role’s definition.
Sourcepub fn snapshot(&self) -> &RoleDefinition<SnapshotMetadata>
pub fn snapshot(&self) -> &RoleDefinition<SnapshotMetadata>
An immutable reference to the snapshot role’s definition.
Sourcepub fn targets(&self) -> &RoleDefinition<TargetsMetadata>
pub fn targets(&self) -> &RoleDefinition<TargetsMetadata>
An immutable reference to the targets role’s definition.
Sourcepub fn timestamp(&self) -> &RoleDefinition<TimestampMetadata>
pub fn timestamp(&self) -> &RoleDefinition<TimestampMetadata>
An immutable reference to the timestamp role’s definition.
Sourcepub fn additional_fields(&self) -> &HashMap<String, Value>
pub fn additional_fields(&self) -> &HashMap<String, Value>
An immutable reference to any additional fields on the metadata.
Trait Implementations§
Source§impl Clone for RootMetadata
impl Clone for RootMetadata
Source§fn clone(&self) -> RootMetadata
fn clone(&self) -> RootMetadata
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RootMetadata
impl Debug for RootMetadata
Source§impl<'de> Deserialize<'de> for RootMetadata
impl<'de> Deserialize<'de> for RootMetadata
Source§fn deserialize<D: Deserializer<'de>>(de: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(de: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<RootMetadata> for RootMetadataBuilder
impl From<RootMetadata> for RootMetadataBuilder
Source§fn from(metadata: RootMetadata) -> Self
fn from(metadata: RootMetadata) -> Self
Converts to this type from the input type.
Source§impl Metadata for RootMetadata
impl Metadata for RootMetadata
Source§impl PartialEq for RootMetadata
impl PartialEq for RootMetadata
Source§impl Serialize for RootMetadata
impl Serialize for RootMetadata
impl Eq for RootMetadata
impl StructuralPartialEq for RootMetadata
Auto Trait Implementations§
impl Freeze for RootMetadata
impl RefUnwindSafe for RootMetadata
impl Send for RootMetadata
impl Sync for RootMetadata
impl Unpin for RootMetadata
impl UnsafeUnpin for RootMetadata
impl UnwindSafe for RootMetadata
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