[−][src]Struct tough::schema::Snapshot
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]
spec_version: String,
version: NonZeroU64,
expires: DateTime<Utc>
) -> Self
Create a new Snapshot
object.
Trait Implementations
impl Clone for Snapshot
[src]
impl Debug for Snapshot
[src]
impl<'de> Deserialize<'de> for Snapshot
[src]
pub fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl PartialEq<Snapshot> for Snapshot
[src]
impl Role for Snapshot
[src]
pub const TYPE: RoleType
[src]
pub fn expires(&self) -> DateTime<Utc>
[src]
pub fn version(&self) -> NonZeroU64
[src]
pub fn filename(&self, consistent_snapshot: bool) -> String
[src]
pub fn role_id(&self) -> RoleId
[src]
pub fn canonical_form(&self) -> Result<Vec<u8>>
[src]
impl Serialize for Snapshot
[src]
pub fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralPartialEq for Snapshot
[src]
Auto Trait Implementations
impl RefUnwindSafe for Snapshot
[src]
impl Send for Snapshot
[src]
impl Sync for Snapshot
[src]
impl Unpin for Snapshot
[src]
impl UnwindSafe for Snapshot
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> DynClone for T where
T: Clone,
[src]
T: Clone,
pub fn __clone_box(&self, Private) -> *mut ()
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,