[][src]Struct cacache::put::PutOpts

pub struct PutOpts { /* fields omitted */ }

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

Methods

impl PutOpts[src]

pub fn new() -> PutOpts[src]

Creates a blank set of cache writing options.

pub fn open<P, K>(self, cache: P, key: K) -> Result<Put, Error> where
    P: AsRef<Path>,
    K: AsRef<str>, 
[src]

Opens the file handle for writing, returning a Put instance.

pub fn algorithm(self, algo: Algorithm) -> Self[src]

Configures the algorithm to write data under.

pub fn size(self, size: usize) -> Self[src]

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

pub fn metadata(self, metadata: Value) -> Self[src]

Sets arbitrary additional metadata to associate with the index entry.

pub fn time(self, time: u128) -> Self[src]

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.

pub fn integrity(self, sri: Integrity) -> Self[src]

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.

pub fn chown(self, uid: Option<Uid>, gid: Option<Gid>) -> Self[src]

Configures the uid and gid to write data as. Useful when dropping privileges while in sudo mode.

impl PutOpts[src]

pub async fn open_async<P, K>(self, cache: P, key: K) -> Result<AsyncPut, Error> where
    P: AsRef<Path>,
    K: AsRef<str>, 
[src]

Opens the file handle for writing, returning a Put instance.

Trait Implementations

impl Clone for PutOpts[src]

impl Default for PutOpts[src]

Auto Trait Implementations

impl Send for PutOpts

impl Sync for PutOpts

impl Unpin for PutOpts

impl UnwindSafe for PutOpts

impl RefUnwindSafe for PutOpts

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,