[go: up one dir, main page]

Struct cacache::WriteOpts

source ·
pub struct WriteOpts { /* private fields */ }
Expand description

Builder for options and flags for opening a new cache file to write data into.

Implementations§

Creates a blank set of cache writing options.

Opens the file handle for writing, returning an Writer instance.

Opens the file handle for writing, without a key returning an Writer instance.

Opens the file handle for writing synchronously, returning a SyncWriter instance.

Opens the file handle for writing, without a key returning an SyncWriter instance.

Configures the algorithm to write data under.

Sets the expected size of the data to write. If there’s a date size mismatch, put.commit() will return an error.

Sets arbitrary additional metadata to associate with the index entry.

Sets the specific time in unix milliseconds to associate with this entry. This is usually automatically set to the write time, but can be useful to change for tests and such.

Sets the expected integrity hash of the written data. If there’s a mismatch between this Integrity and the one calculated by the write, put.commit() will error.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.