pub struct WriteOpts { /* private fields */ }Expand description
Builder for options and flags for opening a new cache file to write data into.
Implementations§
source§impl 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.
sourcepub fn raw_metadata(self, metadata: Vec<u8>) -> Self
pub fn raw_metadata(self, metadata: Vec<u8>) -> Self
Sets arbitrary additional binary metadata to associate with the index entry.