[][src]Struct tough::Settings

pub struct Settings<'a, R: Read> {
    pub root: R,
    pub datastore: &'a Path,
    pub metadata_base_url: &'a str,
    pub targets_base_url: &'a str,
    pub limits: Limits,
    pub expiration_enforcement: ExpirationEnforcement,
}

Repository fetch settings, provided to Repository::load.

Fields

root: R

A Reader to the trusted root metadata file, which you must ship with your software using an out-of-band-process.

This should be a copy of the most recent root.json from your repository. (It's okay if it becomes out of date later; the client establishes trust up to the most recent root.json file.)

datastore: &'a Path

A Path to a directory on a persistent filesystem. Tough stores the most recently fetched timestamp, snapshot, and targets metadata files here to detect version rollback attacks. The directory must exist prior to calling Repository::load.

metadata_base_url: &'a str

The URL base for TUF metadata (such as timestamp.json).

targets_base_url: &'a str

The URL base for targets.

limits: Limits

Limits used when fetching repository metadata.

This parameter implements Default; see its documentation for details.

expiration_enforcement: ExpirationEnforcement

Metadata expiration enforcement.

When this parameter is set to Unsafe, a Repository will succeed in loading even if it has expired metadata files.

CAUTION: TUF metadata expiration dates, particularly timestamp.json, are designed to limit a replay attack window. By setting expiration_enforcement to Unsafe, you are disabling this feature of TUF. Use Safe unless you have a good reason to use Unsafe.

Trait Implementations

impl<'a, R: Clone + Read> Clone for Settings<'a, R>[src]

impl<'a, R: Debug + Read> Debug for Settings<'a, R>[src]

Auto Trait Implementations

impl<'a, R> RefUnwindSafe for Settings<'a, R> where
    R: RefUnwindSafe

impl<'a, R> Send for Settings<'a, R> where
    R: Send

impl<'a, R> Sync for Settings<'a, R> where
    R: Sync

impl<'a, R> Unpin for Settings<'a, R> where
    R: Unpin

impl<'a, R> UnwindSafe for Settings<'a, R> where
    R: UnwindSafe

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<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.