pub struct WriteOpts { /* private fields */ }Expand description
Builder for options and flags for opening a new cache file to write data into.
Implementations
sourceimpl WriteOpts
impl WriteOpts
sourcepub async fn open<P, K>(self, cache: P, key: K) -> Result<Writer> where
P: AsRef<Path>,
K: AsRef<str>,
pub async fn open<P, K>(self, cache: P, key: K) -> Result<Writer> where
P: AsRef<Path>,
K: AsRef<str>,
Opens the file handle for writing, returning an Writer instance.
sourcepub async fn open_hash<P>(self, cache: P) -> Result<Writer> where
P: AsRef<Path>,
pub async fn open_hash<P>(self, cache: P) -> Result<Writer> where
P: AsRef<Path>,
Opens the file handle for writing, without a key returning an Writer instance.
sourcepub fn open_sync<P, K>(self, cache: P, key: K) -> Result<SyncWriter> where
P: AsRef<Path>,
K: AsRef<str>,
pub fn open_sync<P, K>(self, cache: P, key: K) -> Result<SyncWriter> where
P: AsRef<Path>,
K: AsRef<str>,
Opens the file handle for writing synchronously, returning a SyncWriter instance.
sourcepub fn open_hash_sync<P>(self, cache: P) -> Result<SyncWriter> where
P: AsRef<Path>,
pub fn open_hash_sync<P>(self, cache: P) -> Result<SyncWriter> where
P: AsRef<Path>,
Opens the file handle for writing, without a key returning an SyncWriter instance.
sourcepub fn size(self, size: usize) -> Self
pub fn size(self, size: usize) -> Self
Sets the expected size of the data to write. If there’s a date size
mismatch, put.commit() will return an error.
sourcepub fn metadata(self, metadata: Value) -> Self
pub fn metadata(self, metadata: Value) -> Self
Sets arbitrary additional metadata to associate with the index entry.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for WriteOpts
impl Send for WriteOpts
impl Sync for WriteOpts
impl Unpin for WriteOpts
impl UnwindSafe for WriteOpts
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more