[−][src]Struct tough::Repository
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]
&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>,
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 ofroot.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]
pub fn clone(&self) -> Repository
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for Repository
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Repository
[src]
impl !Send for Repository
[src]
impl !Sync for Repository
[src]
impl Unpin for Repository
[src]
impl !UnwindSafe for Repository
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DynClone for T where
T: Clone,
[src]
T: Clone,
pub fn __clone_box(&self, Private) -> *mut ()
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,