Skip to main content

AssetSource

Enum AssetSource 

Source
#[non_exhaustive]
pub enum AssetSource { Vendored(&'static [u8]), External { hint: &'static str, }, Download { files: &'static [DownloadFile], }, PinnedArchive { archives: &'static [PinnedArchive], }, }
Expand description

Where an asset comes from.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Vendored(&'static [u8])

Bytes compiled into this binary, installed as a single file.

§

External

A directory the operator provisions, which Roteiro verifies and pins but never fetches. hint is the exact command that obtains it.

Fields

§hint: &'static str

What to run to obtain it, quoted verbatim in every error.

§

Download

A set of files downloaded by URL into one directory, digest-pinned at provisioning time.

Downloading happens only in provision_with, and only with a fetcher the caller supplied. There is no compile-time digest because the upstream files are republished continuously — OSV rebuilds its per-ecosystem databases daily — so what is pinned is the snapshot this machine provisioned, recorded in InstalledAsset::digest and re-checked on every run. That is the same pin the RustSec checkout gets, and it is the one that can actually be honoured.

Fields

§files: &'static [DownloadFile]

Each file’s path relative to the asset directory, and where it comes from. Order is preserved so prefetch reports progress in a stable sequence.

§

PinnedArchive

A single published release artifact with a compile-time SHA-256, installed as one file and selected by host platform.

Verified in this crate, before installation and again by build.rs before anything is built against it — so neither a lying fetcher nor a redirected URL can substitute different bytes. See crate::runtime_pins for what is pinned and why it has to be.

Fields

§archives: &'static [PinnedArchive]

One entry per supported host platform. A host not listed here cannot be provisioned, and is told which platforms are.

Trait Implementations§

Source§

impl Clone for AssetSource

Source§

fn clone(&self) -> AssetSource

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for AssetSource

Source§

impl Debug for AssetSource

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for AssetSource

Source§

impl PartialEq for AssetSource

Source§

fn eq(&self, other: &AssetSource) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for AssetSource

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.