[][src]Struct tough::Repository

pub struct Repository { /* fields omitted */ }

A TUF repository.

You can create a Repository using a RepositoryLoader.

Implementations

impl Repository[src]

pub fn cache<P1, P2, S>(
    &self,
    metadata_outdir: P1,
    targets_outdir: P2,
    targets_subset: Option<&[S]>,
    cache_root_chain: bool
) -> Result<()> where
    P1: AsRef<Path>,
    P2: AsRef<Path>,
    S: AsRef<str>, 
[src]

Cache an entire or partial repository to disk, including all required metadata. The cached repo will be local, using filesystem paths.

  • metadata_outdir is the directory where cached metadata files will be saved.
  • targets_outdir is the directory where cached targets files will be saved.
  • targets_subset is the list of targets to include in the cached repo. If no subset is specified (None), then all targets are included in the cache.
  • cache_root_chain specifies whether or not we will cache all versions of root.json.

impl Repository[src]

pub fn targets(&self) -> &Signed<Targets>[src]

Returns the list of targets present in the repository.

pub fn root(&self) -> &Signed<Root>[src]

Returns a reference to the signed root

pub fn snapshot(&self) -> &Signed<Snapshot>[src]

Returns a reference to the signed snapshot

pub fn timestamp(&self) -> &Signed<Timestamp>[src]

Returns a reference to the signed timestamp

pub fn all_targets(&self) -> impl Iterator + '_[src]

return a vec of all targets including all target files delegated by targets

pub fn read_target(&self, name: &str) -> Result<Option<impl Read + Send>>[src]

Fetches a target from the repository.

If the repository metadata is expired or there is an issue making the request, Err is returned.

If the requested target is not listed in the repository metadata, Ok(None) is returned.

Otherwise, a reader is returned, which provides streaming access to the target contents before its checksum is validated. If the maximum size is reached or there is a checksum mismatch, the reader returns a std::io::Error. Consumers of this library must not use data from the reader if it returns an error.

pub fn delegated_role(&self, name: &str) -> Option<&DelegatedRole>[src]

Return the named DelegatedRole if found.

Trait Implementations

impl Clone for Repository[src]

impl Debug for Repository[src]

Auto Trait Implementations

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> DynClone for T where
    T: Clone
[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.

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