pub struct AssetEntry {
pub sha256: String,
pub size: u64,
pub immutable: bool,
pub encodings: Vec<Encoding>,
}Expand description
What the index records about one file.
Fields§
§sha256: StringLowercase hex sha256 of the identity bytes — the file’s strong ETag,
and the same digest a mesofact manifest records as content_hash.
size: u64Identity size in bytes. A reader compares it with the file on disk and ignores an entry that no longer describes the file.
immutable: boolDeclared content-addressed: safe to cache for a year without revalidating.
encodings: Vec<Encoding>Precompressed variants present beside the file, in preference order.
Implementations§
Source§impl AssetEntry
impl AssetEntry
Sourcepub fn etag(&self, encoding: Option<Encoding>) -> String
pub fn etag(&self, encoding: Option<Encoding>) -> String
The strong ETag (quotes included) of the representation in
encoding. Each encoding is a distinct representation and must carry a
distinct tag, or a cache could answer a gzip-only client with brotli
bytes it validated against the identity tag.
Sourcepub fn cache_control(&self) -> &'static str
pub fn cache_control(&self) -> &'static str
Cache-Control value for this file.
Trait Implementations§
Source§impl Clone for AssetEntry
impl Clone for AssetEntry
Source§impl Debug for AssetEntry
impl Debug for AssetEntry
Source§impl<'de> Deserialize<'de> for AssetEntry
impl<'de> Deserialize<'de> for AssetEntry
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
impl Eq for AssetEntry
Source§impl PartialEq for AssetEntry
impl PartialEq for AssetEntry
Source§impl Serialize for AssetEntry
impl Serialize for AssetEntry
impl StructuralPartialEq for AssetEntry
Auto Trait Implementations§
impl Freeze for AssetEntry
impl RefUnwindSafe for AssetEntry
impl Send for AssetEntry
impl Sync for AssetEntry
impl Unpin for AssetEntry
impl UnsafeUnpin for AssetEntry
impl UnwindSafe for AssetEntry
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.