pub struct CratesIoResolver { /* private fields */ }Expand description
Resolve a selector against crates.io, or against the cache alone.
Implementations§
Source§impl CratesIoResolver
impl CratesIoResolver
Sourcepub const fn offline(self, offline: bool) -> Self
pub const fn offline(self, offline: bool) -> Self
The same resolver, forbidden to reach the network.
Sourcepub fn with_index_root(self, root: &str) -> Self
pub fn with_index_root(self, root: &str) -> Self
The same resolver, reading a different index root.
A test serves the protocol from a local directory this way, so the suite exercises the resolver rather than a stub of it.
Sourcepub fn latest_version(&self) -> Result<Version, AppError>
pub fn latest_version(&self) -> Result<Version, AppError>
The highest stable, non-yanked release the index serves.
One index read and nothing more: no archive is fetched. A cached
answer cannot prove freshness, so this always reaches the index and
--offline refuses it.
§Errors
AppError::Refused where the network is refused or the index
lists no stable release.
Sourcepub fn index_path(name: &str) -> String
pub fn index_path(name: &str) -> String
The sparse index path for a crate name, as the protocol defines it.
Trait Implementations§
Source§impl Clone for CratesIoResolver
impl Clone for CratesIoResolver
Source§fn clone(&self) -> CratesIoResolver
fn clone(&self) -> CratesIoResolver
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 Debug for CratesIoResolver
impl Debug for CratesIoResolver
Source§impl ReleaseResolver for CratesIoResolver
impl ReleaseResolver for CratesIoResolver
Auto Trait Implementations§
impl Freeze for CratesIoResolver
impl RefUnwindSafe for CratesIoResolver
impl Send for CratesIoResolver
impl Sync for CratesIoResolver
impl Unpin for CratesIoResolver
impl UnsafeUnpin for CratesIoResolver
impl UnwindSafe for CratesIoResolver
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