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 for WriteStorage
impl PartialEq for WriteStorage
impl Copy for WriteStorage
impl Eq for WriteStorage
impl StructuralPartialEq for WriteStorage
Auto Trait Implementations§
impl Freeze for WriteStorage
impl RefUnwindSafe for WriteStorage
impl Send for WriteStorage
impl Sync for WriteStorage
impl Unpin for WriteStorage
impl UnwindSafe for WriteStorage
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
Mutably borrows from an owned value. Read more
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)
🔬This is a nightly-only experimental API. (
clone_to_uninit)