pub struct CratesIo { /* private fields */ }
Expand description
crates.io
Retriever
implementation.
It uses reqwest::Client
to fetch the crates.io
API and retrieve the metadata of a dependency..
Note that this Retriever
implementation is deprecated in favour of the DocsRs
one.
Although this Retriever
is faster than the DocsRs
one for recent uploaded crates (docs.rs takes a while to compile the docs of a crate), it’s slower if the crate doesn’t declare a license in its metadata (only a license-file) as it will have to make more requests to get it.
Indeed, it basically ends up calling the DocsRs
Retriever
under the hood when it faces this scenario.
You can provide yourself an instance of reqwest::Client
by using the CratesIo::new
constructor.
If you use CratesIo::default
, it will instantiate a new reqwest::Client
under the hood.
Implementations§
Trait Implementations§
Source§impl Default for CratesIo
impl Default for CratesIo
Source§fn default() -> Self
fn default() -> Self
Creates a new Retriever
using the given reqwest::Client
.
If you don’t want to pass a reqwest::Client
instance, consider using the CratesIo::default
method.
Source§impl Retriever for CratesIo
impl Retriever for CratesIo
Source§type Response = Pin<Box<dyn Future<Output = RetrievedDependency> + Send>>
type Response = Pin<Box<dyn Future<Output = RetrievedDependency> + Send>>
RetrievedDependency
.
It cannot fail.Source§fn get_dependency(&self, dependency: Dependency) -> Self::Response
fn get_dependency(&self, dependency: Dependency) -> Self::Response
Auto Trait Implementations§
impl Freeze for CratesIo
impl !RefUnwindSafe for CratesIo
impl Send for CratesIo
impl Sync for CratesIo
impl Unpin for CratesIo
impl !UnwindSafe for CratesIo
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
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>
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>
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 more