Struct licensebat_rust::retriever::DocsRs
source · 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
§type Response = Pin<Box<dyn Future<Output = RetrievedDependency> + Send + 'static, Global>>
type Response = Pin<Box<dyn Future<Output = RetrievedDependency> + Send + 'static, Global>>
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.