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::Cache;

let cache = Cache::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]

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 Debug for Metadata[src]

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

impl Serialize for Metadata[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> From<T> for T[src]

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

impl<T> Pointable for T

type Init = T

The type for initializers.

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>,