[−][src]Struct crossref::Crossref
Struct for Crossref search API methods
Fields
base_url: String
use another base url than api.crossref.org
client: Client
the reqwest client that handles the requests
Methods
impl Crossref
[src]
pub fn funder_works_query(
&self,
id: &str,
query: WorksQuery
) -> Result<WorkList>
[src]
&self,
id: &str,
query: WorksQuery
) -> Result<WorkList>
Return one page of the components's Work
that match the query
pub fn member_works_query(
&self,
id: &str,
query: WorksQuery
) -> Result<WorkList>
[src]
&self,
id: &str,
query: WorksQuery
) -> Result<WorkList>
Return one page of the components's Work
that match the query
pub fn type_works_query(&self, id: &str, query: WorksQuery) -> Result<WorkList>
[src]
Return one page of the components's Work
that match the query
pub fn journal_works_query(
&self,
id: &str,
query: WorksQuery
) -> Result<WorkList>
[src]
&self,
id: &str,
query: WorksQuery
) -> Result<WorkList>
Return one page of the components's Work
that match the query
pub fn builder() -> CrossrefBuilder
[src]
Constructs a new CrossrefBuilder
.
This is the same as Crossref::builder()
.
pub fn works(&self, query: WorksQuery) -> Result<WorkList>
[src]
Return the Work
items that match a certain query.
To search only by query terms use the convenience query method Crossref::query_works
Example
use crossref::{Crossref, WorksQuery, WorksFilter, FieldQuery}; let client = Crossref::builder().build()?; let query = WorksQuery::new() .query("Machine Learning") .filter(WorksFilter::HasOrcid) .order(crossref::Order::Asc) .field_query(FieldQuery::author("Some Author")) .sort(crossref::Sort::Score); let works = client.works(query)?;
use crossref::{Crossref, WorksQuery, WorksFilter}; let client = Crossref::builder().build()?; // request a next-cursor first let query = WorksQuery::new() .query("Machine Learning") .new_cursor(); let works = client.works(query.clone())?; // this continues from where this first response stopped // if no more work items are available then a empty list will be returned let deep_works = client.works( query.next_cursor(&works.next_cursor.unwrap()) )?;
Errors
This method fails if the works
element expands to a bad route ResourceNotFound
Fails if the response body doesn't have message
field MissingMessage
.
Fails if anything else than a WorkList
is returned as message UnexpectedItem
pub fn work(&self, doi: &str) -> Result<Work>
[src]
Return the Work
that is identified by the doi
.
Errors
This method fails if the doi could not identified ResourceNotFound
pub fn work_agency(&self, doi: &str) -> Result<WorkAgency>
[src]
Return the Agency
that registers the Work
identified by the doi
.
Errors
This method fails if the doi could not identified ResourceNotFound
pub fn query_works(&self, term: &str) -> Result<WorkList>
[src]
Convenience method to execute Crossref::works with a query only consisting of terms.
Example
let client = crossref::Crossref::builder().build()?; let works = client.query_works("Machine Learning")?;
This would be the same as
use crossref::{Crossref, WorksQuery, WorksFilter}; let client = Crossref::builder().build()?; let works = client.works(WorksQuery::new() .query("Machine Learning"))?;
pub fn funders(&self, funders: FundersQuery) -> Result<FunderList>
[src]
Return the matching Funders
items.
pub fn funder(&self, id: &str) -> Result<Funder>
[src]
Return the Funder
for the id
pub fn funder_works(&self, funder_id: &str, term: &str) -> Result<WorkList>
[src]
Return one page of the funder's Work
that match the query
pub fn members(&self, members: MembersQuery) -> Result<MemberList>
[src]
Return the matching Members
items.
pub fn member(&self, id: &str) -> Result<Member>
[src]
Return the Member
for the id
pub fn member_works(&self, member_id: &str, term: &str) -> Result<WorkList>
[src]
Return one page of the member's Work
that match the query
pub fn prefix(&self, id: &str) -> Result<Prefix>
[src]
Return the Prefix
for the id
pub fn prefix_works(&self, prefix_id: &str, term: &str) -> Result<WorkList>
[src]
Return one page of the prefix's Work
items that match the query
pub fn types(&self) -> Result<TypeList>
[src]
Return all available Type
pub fn type_(&self, id: &str) -> Result<CrossrefType>
[src]
Return the Type
for the id
pub fn type_works(&self, type_: Type, term: &str) -> Result<WorkList>
[src]
Return one page of the types's Work
items that match the query
pub fn random_dois(&self, len: usize) -> Result<Vec<String>>
[src]
Get a random set of DOIs
Example
use crossref::Crossref; // this will return 10 random dois from the crossref api let random_dois = client.random_dois(10)?;
Trait Implementations
impl Clone for Crossref
[src]
fn clone(&self) -> Crossref
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Crossref
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Erased for T
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,