Struct consecrates::Query[][src]

pub struct Query {
    pub string: Option<String>,
    pub page: Option<usize>,
    pub per_page: Option<usize>,
    pub keyword: Option<String>,
    pub category: Option<Category>,
    pub sort: Option<Sorting>,
}

Describes options for a single query.

Fields

string: Option<String>

String passed to the api as query

page: Option<usize>

Number of the page to get, numbering starts at 1

per_page: Option<usize>

Number of results per page

keyword: Option<String>

Match crates that contain a certain string keyword

category: Option<Category>

Specify one of the available categories

sort: Option<Sorting>

Sort the results on the API query level

Implementations

impl Query[src]

pub fn from_str(input: &str) -> Self[src]

Parses raw string into a query struct.

Examples

Search for api string in the web-programming category, showing the most recently updated crates first:

api cat=web sort=update

Search for net string in the game-development category, sorting by amount of recent downloads.

net cat=gamedev sort=rdl

Trait Implementations

impl Default for Query[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.