pub struct PolicyFetch<S, V> {
pub source: S,
pub verifier: V,
}Expand description
A Fetch that runs fetch_release over any source and verifier, writing the proven
bytes to the destination the cache gave it, and nothing when the policy refuses.
HttpsFetch is this over GitHub and the public-good root; a test answers with a release
of its own.
Fields§
§source: S§verifier: VTrait Implementations§
Source§impl<S, V> Clone for PolicyFetch<S, V>
impl<S, V> Clone for PolicyFetch<S, V>
Source§fn clone(&self) -> PolicyFetch<S, V>
fn clone(&self) -> PolicyFetch<S, V>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<S, V> Debug for PolicyFetch<S, V>
impl<S, V> Debug for PolicyFetch<S, V>
Source§impl<S, V> Default for PolicyFetch<S, V>
impl<S, V> Default for PolicyFetch<S, V>
Source§fn default() -> PolicyFetch<S, V>
fn default() -> PolicyFetch<S, V>
Returns the “default value” for a type. Read more
Source§impl<S, V> Fetch for PolicyFetch<S, V>where
S: ReleaseSource,
V: AttestationVerifier,
impl<S, V> Fetch for PolicyFetch<S, V>where
S: ReleaseSource,
V: AttestationVerifier,
Source§fn fetch(
&self,
tag: &str,
dest: &Path,
progress: &mut dyn FnMut(&str),
) -> Result<Verification, String>
fn fetch( &self, tag: &str, dest: &Path, progress: &mut dyn FnMut(&str), ) -> Result<Verification, String>
Download release
tag’s daemon asset to dest and prove the bytes, reporting
progress lines as it goes. The error is prose: the caller owns the remedies.Source§fn fetch_bytes(
&self,
tag: &str,
_: &Path,
progress: &mut dyn FnMut(&str),
) -> Result<Fetched, String>
fn fetch_bytes( &self, tag: &str, _: &Path, progress: &mut dyn FnMut(&str), ) -> Result<Fetched, String>
Return the verified bytes.
dest is a private temporary file for legacy
implementations of Self::fetch; production fetches return their verified
in-memory download without reading it back from disk.Auto Trait Implementations§
impl<S, V> Freeze for PolicyFetch<S, V>
impl<S, V> RefUnwindSafe for PolicyFetch<S, V>where
S: RefUnwindSafe,
V: RefUnwindSafe,
impl<S, V> Send for PolicyFetch<S, V>
impl<S, V> Sync for PolicyFetch<S, V>
impl<S, V> Unpin for PolicyFetch<S, V>
impl<S, V> UnsafeUnpin for PolicyFetch<S, V>where
S: UnsafeUnpin,
V: UnsafeUnpin,
impl<S, V> UnwindSafe for PolicyFetch<S, V>where
S: UnwindSafe,
V: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.