[−][src]Struct cacache::put::PutOpts
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]
P: AsRef<Path>,
K: AsRef<str>,
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]
P: AsRef<Path>,
K: AsRef<str>,
Opens the file handle for writing, returning a Put instance.
Trait Implementations
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]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,