pub struct DocsRs { /* private fields */ }
Expand description
docs.rs
Retriever
implementation.
It uses reqwest::Client
to scrap the docs.rs
website and retrieve the metadata of a dependency.
Note that when a crate is published it takes a while for the docs.rs
website to compile it, so it can take a while to retrieve the metadata of recently uploaded crate.
You can provide yourself an instance of reqwest::Client
by using the DocsRs::new
constructor.
If you use DocsRs::default
, it will instantiate a new reqwest::Client
under the hood.
Implementations§
Trait Implementations§
Source§impl Default for DocsRs
impl Default for DocsRs
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 DocsRs::default
method.
Source§impl Retriever for DocsRs
impl Retriever for DocsRs
Source§type Response = Pin<Box<dyn Future<Output = RetrievedDependency> + Send>>
type Response = Pin<Box<dyn Future<Output = RetrievedDependency> + Send>>
Future that resolves to a
RetrievedDependency
.
It cannot fail.Source§fn get_dependency(&self, dependency: Dependency) -> Self::Response
fn get_dependency(&self, dependency: Dependency) -> Self::Response
Validates dependency’s information from the original source.
Auto Trait Implementations§
impl Freeze for DocsRs
impl !RefUnwindSafe for DocsRs
impl Send for DocsRs
impl Sync for DocsRs
impl Unpin for DocsRs
impl !UnwindSafe for DocsRs
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
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>
Converts
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>
Converts
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