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]
impl Metadata
[src]pub fn get_last_modified(&self) -> Option<SystemTime>
[src]
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]
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_hits(&self) -> u64
[src]
pub fn get_hits(&self) -> u64
[src]The total number of times this entry has been read.
NOTE: This will be 0 unless track_access
is enabled from the CacheBuilder
pub fn get_last_acccessed(&self) -> Option<SystemTime>
[src]
pub fn get_last_acccessed(&self) -> Option<SystemTime>
[src]Retrives the last time this entry was accessed (read from).
NOTE: This will be the same as get_last_modified
unless track_access
is enabled from
the CacheBuilder
pub fn get_last_accessed_raw(&self) -> u64
[src]
pub fn get_last_accessed_raw(&self) -> u64
[src]Retrieves the raw last_accessed
time, which is the milliseconds since
time::UNIX_EPOCH
. If the returned result is 0
, that means there is no last_accessed
time.
NOTE: This will be the same as get_last_modified_raw
unless track_access
is enabled
from the CacheBuilder
pub fn get_integrity(&self) -> &Md5Bytes
[src]
pub fn get_integrity(&self) -> &Md5Bytes
[src]Retrieves the internal Md5Bytes
integrity of the corresponding metadata entry.
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]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Metadata
impl Send for Metadata
impl Sync for Metadata
impl Unpin for Metadata
impl UnwindSafe for Metadata
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,