Skip to main content

CrateReleaseSource

Struct CrateReleaseSource 

Source
pub struct CrateReleaseSource { /* private fields */ }
Expand description

The crates venue for one selector.

Implementations§

Source§

impl CrateReleaseSource

Source

pub fn new(selector: &str) -> Result<Self, RkError>

A source for selector — latest or an exact version — caching under the state root.

§Errors

Returns RkError::Refusal when no state root can be located.

Source

pub fn with_cache(selector: &str, cache: impl Into<PathBuf>) -> Self

A source caching under an explicit directory.

Source

pub fn selector(&self) -> &str

The selector as given.

Source

pub fn resolve(&self) -> Result<&Resolved, RkError>

Resolve the selector, fetch and verify the archive where the cache does not hold it, and answer with what happened. Idempotent: the second call answers from the first.

§Errors

Returns a registry-unreachable refusal when the index or the archive cannot be fetched, a bundle-unverified refusal when the archive’s digest differs from the index checksum, and a usage error for a version the index does not list.

Trait Implementations§

Source§

impl Debug for CrateReleaseSource

Source§

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

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

impl ReleaseSource for CrateReleaseSource

Source§

fn manifest(&self) -> Result<ReleaseManifest, RkError>

The bundle’s manifest. Read more
Source§

fn blob(&self, digest: &Digest) -> Result<Vec<u8>, RkError>

The bytes behind one digest the manifest names. Read more

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.