Struct cargo_whatfeatures::Client
source · pub struct Client { /* private fields */ }
Expand description
An HTTP client for interacting with crates.io
Implementations§
source§impl Client
impl Client
sourcepub fn new(host: impl ToString) -> Self
pub fn new(host: impl ToString) -> Self
Create a new HTTP client with the provided host (e.g. https://crates.io
or http://localhost
)
sourcepub fn cache_latest(&self, crate_name: &str) -> Result<Crate>
pub fn cache_latest(&self, crate_name: &str) -> Result<Crate>
Lookup and cache the latest version for this crate
sourcepub fn cache_crate(
&self,
crate_name: &str,
crate_version: &str
) -> Result<Crate>
pub fn cache_crate( &self, crate_name: &str, crate_version: &str ) -> Result<Crate>
Lookup and cache the specified version for this crate
sourcepub fn get_latest(&self, crate_name: &str) -> Result<Version>
pub fn get_latest(&self, crate_name: &str) -> Result<Version>
Get the latest version for this crate
Auto Trait Implementations§
impl Freeze for Client
impl RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnwindSafe for Client
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