Skip to main content

CrossrefQueryParam

Trait CrossrefQueryParam 

Source
pub trait CrossrefQueryParam {
    // Required methods
    fn param_key(&self) -> Cow<'_, str>;
    fn param_value(&self) -> Option<Cow<'_, str>>;

    // Provided method
    fn param(&self) -> Cow<'_, str> { ... }
}
Expand description

a trait used to capture parameters for the query string of the crossref api

Required Methods§

Source

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

the key name of the parameter in the query string

Source

fn param_value(&self) -> Option<Cow<'_, str>>

the value of the parameter, if any

Provided Methods§

Source

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

constructs the full parameter for the query string by combining the key and value

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl CrossrefQueryParam for Vec<FacetCount>

Source§

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

Source§

fn param_value(&self) -> Option<Cow<'_, str>>

Source§

impl<T: AsRef<str>> CrossrefQueryParam for (T, T)

Source§

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

Source§

fn param_value(&self) -> Option<Cow<'_, str>>

Source§

impl<T: Filter> CrossrefQueryParam for Vec<T>

Source§

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

always use filter as the key

Source§

fn param_value(&self) -> Option<Cow<'_, str>>

filters are multi value and values are concat with ,

Implementors§