Enum agde_io::WriteStorage
source · pub enum WriteStorage {
Public(WriteMtime, SystemTime),
Current(WriteMtime),
Meta,
}
Variants§
Public(WriteMtime, SystemTime)
The copy of data which is maintained to be equal to the others’ public storages.
See WriteFn
and Options::write
for more details on the data.
Current(WriteMtime)
The copy of data the user writes to.
The WriteMtime
signals if we should update the mtime.
Meta
Storage of metadata objects.
Implementations§
source§impl WriteStorage
impl WriteStorage
pub fn current() -> Self
pub fn current_without_update() -> Self
pub fn to_storage(&self) -> Storage
source§impl WriteStorage
impl WriteStorage
sourcepub async fn update_metadata<MtimeFuture: Future<Output = Option<SystemTime>>>(
&self,
metadata: &Mutex<Metadata>,
offline_metadata: &Mutex<Metadata>,
resource: String,
data_len: usize,
mtime: impl FnOnce(Storage, String) -> MtimeFuture
) -> Result<(), ()>
pub async fn update_metadata<MtimeFuture: Future<Output = Option<SystemTime>>>( &self, metadata: &Mutex<Metadata>, offline_metadata: &Mutex<Metadata>, resource: String, data_len: usize, mtime: impl FnOnce(Storage, String) -> MtimeFuture ) -> Result<(), ()>
Update the metadata
and offline_metadata
according to what storage you’re writing to.
Errors
Returns an error if self
is WriteStorage::Current
with WriteMtime::LookUpCurrent
and mtime
returns None
(the resource doesn’t exist).
Trait Implementations§
source§impl Clone for WriteStorage
impl Clone for WriteStorage
source§fn clone(&self) -> WriteStorage
fn clone(&self) -> WriteStorage
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for WriteStorage
impl Debug for WriteStorage
source§impl PartialEq<WriteStorage> for WriteStorage
impl PartialEq<WriteStorage> for WriteStorage
source§fn eq(&self, other: &WriteStorage) -> bool
fn eq(&self, other: &WriteStorage) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.