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 fn open<P, K>(self, cache: P, key: K) -> Result<Writer>
pub fn open<P, K>(self, cache: P, key: K) -> Result<Writer>
Opens the file handle for writing synchronously, returning a SyncWriter instance.
Sourcepub fn open_hash<P>(self, cache: P) -> Result<Writer>
pub fn open_hash<P>(self, cache: P) -> Result<Writer>
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 Freeze for WriteOpts
impl RefUnwindSafe for WriteOpts
impl Send for WriteOpts
impl Sync for WriteOpts
impl Unpin for WriteOpts
impl UnwindSafe for WriteOpts
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§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more