Skip to main content

FieldQuery

Enum FieldQuery 

Source
pub enum FieldQuery {
Show 21 variants Title(String), ContainerTitle(String), Author(String), Editor(String), Chair(String), Translator(String), Contributor(String), Bibliographic(String), Affiliation(String), Degree(String), Description(String), EventAcronym(String), EventLocation(String), EventName(String), EventSponsor(String), EventTheme(String), FunderName(String), PublisherLocation(String), PublisherName(String), StandardsBodyAcronym(String), StandardsBodyName(String),
}
Expand description

Matches against one field of a work’s metadata rather than all of it. Available on the /works route only.

assert_eq!("query.author", FieldQuery::author("feynman").name());

Covers all 21 field queries /works accepts, which every_field_query_is_accepted_by_the_api pins against what the api reports.

Variants§

§

Title(String)

matches against title: titles, including the subtitle

§

ContainerTitle(String)

matches against container-title: the title of the containing work, aka publication.name

§

Author(String)

matches against author: author given and family names

§

Editor(String)

matches against editor: editor given and family names

§

Chair(String)

matches against chair: chair given and family names

§

Translator(String)

matches against translator: translator given and family names

§

Contributor(String)

matches against contributor: author, editor, chair and translator given and family names

§

Bibliographic(String)

matches against bibliographic: bibliographic information, useful for citation look up. Includes titles, authors, ISSNs and publication years

§

Affiliation(String)

matches against affiliation: contributor affiliations

§

Degree(String)

matches against degree: the degree a dissertation was awarded for

§

Description(String)

matches against description: the description deposited for posted content

§

EventAcronym(String)

matches against event-acronym: the short form of an event’s name

§

EventLocation(String)

matches against event-location: where an event was held

§

EventName(String)

matches against event-name: an event’s name

§

EventSponsor(String)

matches against event-sponsor: who sponsored an event

§

EventTheme(String)

matches against event-theme: an event’s theme

§

FunderName(String)

matches against funder-name: the name of a funding body, for works whose funder carries no registry DOI

§

PublisherLocation(String)

matches against publisher-location: where the publisher is located

§

PublisherName(String)

matches against publisher-name: the publisher’s name

§

StandardsBodyAcronym(String)

matches against standards-body-acronym: the short form of a standards body’s name

§

StandardsBodyName(String)

matches against standards-body-name: the name of the body that issued a standard

Implementations§

Source§

impl FieldQuery

Source

pub const ALL_FIELDS: &'static [&'static str]

Every field /works can be queried against, in declaration order – the author of query.author.

Source

pub fn name(&self) -> &'static str

the key this renders under in the query string, e.g. query.author

Source

pub fn field(&self) -> &'static str

the field crossref knows this by, e.g. author

Source

pub fn value(&self) -> &str

the term being matched

Source

pub fn from_field(field: &str, value: impl Into<String>) -> Option<Self>

The query against the field crossref knows by this name, the inverse of FieldQuery::field, or None if /works carries no such field. For callers that learn the field at runtime – a command line flag, a config file – rather than writing it out.

assert_eq!(
    Some(FieldQuery::author("feynman")),
    FieldQuery::from_field("author", "feynman")
);
assert_eq!(None, FieldQuery::from_field("query.author", "feynman"));
Source

pub fn title(value: impl Into<String>) -> Self

a query against title

Source

pub fn container_title(value: impl Into<String>) -> Self

a query against container-title

Source

pub fn author(value: impl Into<String>) -> Self

a query against author

Source

pub fn editor(value: impl Into<String>) -> Self

a query against editor

Source

pub fn chair(value: impl Into<String>) -> Self

a query against chair

Source

pub fn translator(value: impl Into<String>) -> Self

a query against translator

Source

pub fn contributor(value: impl Into<String>) -> Self

a query against contributor

Source

pub fn bibliographic(value: impl Into<String>) -> Self

a query against bibliographic

Source

pub fn affiliation(value: impl Into<String>) -> Self

a query against affiliation

Source

pub fn degree(value: impl Into<String>) -> Self

a query against degree

Source

pub fn description(value: impl Into<String>) -> Self

a query against description

Source

pub fn event_acronym(value: impl Into<String>) -> Self

a query against event-acronym

Source

pub fn event_location(value: impl Into<String>) -> Self

a query against event-location

Source

pub fn event_name(value: impl Into<String>) -> Self

a query against event-name

Source

pub fn event_sponsor(value: impl Into<String>) -> Self

a query against event-sponsor

Source

pub fn event_theme(value: impl Into<String>) -> Self

a query against event-theme

Source

pub fn funder_name(value: impl Into<String>) -> Self

a query against funder-name

Source

pub fn publisher_location(value: impl Into<String>) -> Self

a query against publisher-location

Source

pub fn publisher_name(value: impl Into<String>) -> Self

a query against publisher-name

Source

pub fn standards_body_acronym(value: impl Into<String>) -> Self

a query against standards-body-acronym

Source

pub fn standards_body_name(value: impl Into<String>) -> Self

a query against standards-body-name

Trait Implementations§

Source§

impl Clone for FieldQuery

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl CrossrefQueryParam for FieldQuery

Source§

fn params(&self) -> Vec<(Cow<'_, str>, Cow<'_, str>)>

The key/value pairs this element contributes to the query string. Read more
Source§

impl Debug for FieldQuery

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for FieldQuery

Source§

impl PartialEq for FieldQuery

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for FieldQuery

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more