[][src]Struct tough::schema::Snapshot

pub struct Snapshot {
    pub spec_version: String,
    pub version: NonZeroU64,
    pub expires: DateTime<Utc>,
    pub meta: HashMap<String, SnapshotMeta>,
    pub _extra: HashMap<String, Value>,
}

TUF 4.4 The snapshot.json file is signed by the snapshot role. It MUST list the version numbers of the top-level targets metadata and all delegated targets metadata. It MAY also list their lengths and file hashes.

Fields

spec_version: String

A string that contains the version number of the TUF specification. Its format follows the Semantic Versioning 2.0.0 (semver) specification.

version: NonZeroU64

An integer that is greater than 0. Clients MUST NOT replace a metadata file with a version number less than the one currently trusted.

expires: DateTime<Utc>

Determines when metadata should be considered expired and no longer trusted by clients.

meta: HashMap<String, SnapshotMeta>

A list of what the TUF spec calls 'METAFILES' (SnapshotMeta objects). The TUF spec describes the hash key in 4.4: METAPATH is the file path of the metadata on the repository relative to the metadata base URL. For snapshot.json, these are top-level targets metadata and delegated targets metadata.

_extra: HashMap<String, Value>

Extra arguments found during deserialization.

We must store these to correctly verify signatures for this object.

If you're instantiating this struct, you should make this HashMap::empty().

Implementations

impl Snapshot[src]

pub fn new(
    spec_version: String,
    version: NonZeroU64,
    expires: DateTime<Utc>
) -> Self
[src]

Create a new Snapshot object.

Trait Implementations

impl Clone for Snapshot[src]

impl Debug for Snapshot[src]

impl<'de> Deserialize<'de> for Snapshot[src]

impl PartialEq<Snapshot> for Snapshot[src]

impl Role for Snapshot[src]

impl Serialize for Snapshot[src]

impl StructuralPartialEq for Snapshot[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> DynClone for T where
    T: Clone
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,