pub struct ResourceMeta { /* private fields */ }
Expand description
The metadata of a resource.
Implementations§
source§impl ResourceMeta
impl ResourceMeta
sourcepub fn new(mtime_in_current: Option<SystemTime>, size: u64) -> Self
pub fn new(mtime_in_current: Option<SystemTime>, size: u64) -> Self
size
is the length of the data.
§mtime_in_current
mtime_in_current
is the modify time of the resource in the current storage.
Is None
if this resource has not yet been written to the current storage.
In that case, there’s always a change. This can occur when data has been written to the
public storage, and the current storage hasn’t gotten that data yet.
sourcepub fn new_from_event(
mtime_in_current: Option<SystemTime>,
event_mtime: SystemTime,
size: u64,
) -> Self
pub fn new_from_event( mtime_in_current: Option<SystemTime>, event_mtime: SystemTime, size: u64, ) -> Self
Same as Self::new
but with an additional argument - event_mtime
.
It represents the time of the latest event which acted upon the resource. Only use this function for the public storage, as it’s useless elsewhere.
sourcepub fn mtime_in_current(&self) -> Option<SystemTime>
pub fn mtime_in_current(&self) -> Option<SystemTime>
Mtime of this resource in the current storage.
None
if this hasn’t been written to the curren storage.
sourcepub fn mtime_of_last_event(&self) -> SystemTime
pub fn mtime_of_last_event(&self) -> SystemTime
The timestamp of the last modification to this resource by an event.
Only applicable to the public storage.
None
if this hasn’t been written to the curren storage.
sourcepub fn set_mtime_in_current(&mut self, mtime_in_current: Option<SystemTime>)
pub fn set_mtime_in_current(&mut self, mtime_in_current: Option<SystemTime>)
Update the metadata.
Trait Implementations§
source§impl Clone for ResourceMeta
impl Clone for ResourceMeta
source§fn clone(&self) -> ResourceMeta
fn clone(&self) -> ResourceMeta
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ResourceMeta
impl Debug for ResourceMeta
source§impl<'de> Deserialize<'de> for ResourceMeta
impl<'de> Deserialize<'de> for ResourceMeta
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>,
source§impl PartialEq for ResourceMeta
impl PartialEq for ResourceMeta
source§impl Serialize for ResourceMeta
impl Serialize for ResourceMeta
impl Copy for ResourceMeta
impl Eq for ResourceMeta
impl StructuralPartialEq for ResourceMeta
Auto Trait Implementations§
impl Freeze for ResourceMeta
impl RefUnwindSafe for ResourceMeta
impl Send for ResourceMeta
impl Sync for ResourceMeta
impl Unpin for ResourceMeta
impl UnwindSafe for ResourceMeta
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)