Struct forceps::Metadata [−][src]
pub struct Metadata { /* fields omitted */ }Metadata information about a certain entry in the cache
This metadata contains information about when the entry was last modified, the size (in bytes)
of the entry, the md5 integrity of the entry, etc.
Examples
use forceps::CacheBuilder; let cache = CacheBuilder::new("./cache") .build() .await .unwrap(); cache.write(&b"MY_KEY", &b"Hello World").await.unwrap(); let metadata = cache.read_metadata(&b"MY_KEY").unwrap();
Implementations
impl Metadata[src]
impl Metadata[src]pub fn get_size(&self) -> u64[src]
The size in bytes of the corresponding cache entry.
pub fn get_last_modified(&self) -> Option<SystemTime>[src]
Retrives the last time this entry was modified.
pub fn get_last_modified_raw(&self) -> u64[src]
Retrieves the raw last_modified time, which is the milliseconds since
time::UNIX_EPOCH. If the returned result is 0, that means there is no last_modified
time.
pub fn get_integrity(&self) -> &Md5Bytes[src]
Retrieves the internal Md5Bytes integrity of the corresponding metadata entry.
pub fn check_integrity_of(&self, data: &[u8]) -> bool[src]
Verifies that the metadata integrity matches the integrity of the data provided.
Trait Implementations
impl<'de> Deserialize<'de> for Metadata[src]
impl<'de> Deserialize<'de> for Metadata[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>, [src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl RefUnwindSafe for Metadata
impl RefUnwindSafe for Metadataimpl UnwindSafe for Metadata
impl UnwindSafe for MetadataBlanket Implementations
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>, [src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>, [src]impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,