SearchRequestBuilder

Struct SearchRequestBuilder 

Source
pub struct SearchRequestBuilder<S: State = Empty> { /* private fields */ }
Expand description

Use builder syntax to set the inputs and finish with build_internal().

Implementations§

Source§

impl<S: State> SearchRequestBuilder<S>

Source

pub fn query( self, value: Vec<SearchQueryItem>, ) -> SearchRequestBuilder<SetQuery<S>>
where S::Query: IsUnset,

Optional (Some / Option setters).

A list of items of which the query is composed of

See SearchQueryItem for more information

Source

pub fn maybe_query( self, value: Option<Vec<SearchQueryItem>>, ) -> SearchRequestBuilder<SetQuery<S>>
where S::Query: IsUnset,

Optional (Some / Option setters).

A list of items of which the query is composed of

See SearchQueryItem for more information

Source

pub fn categories( self, value: Categories, ) -> SearchRequestBuilder<SetCategories<S>>
where S::Categories: IsUnset,

Optional (Some / Option setters).

Turn categories on or off

Source

pub fn maybe_categories( self, value: Option<Categories>, ) -> SearchRequestBuilder<SetCategories<S>>
where S::Categories: IsUnset,

Optional (Some / Option setters).

Turn categories on or off

Source

pub fn purity(self, value: Purities) -> SearchRequestBuilder<SetPurity<S>>
where S::Purity: IsUnset,

Optional (Some / Option setters).

Turn categories on or off, NSFW requires a valid api key

Source

pub fn maybe_purity( self, value: Option<Purities>, ) -> SearchRequestBuilder<SetPurity<S>>
where S::Purity: IsUnset,

Optional (Some / Option setters).

Turn categories on or off, NSFW requires a valid api key

Source

pub fn sorting(self, value: SortingType) -> SearchRequestBuilder<SetSorting<S>>
where S::Sorting: IsUnset,

Optional (Some / Option setters).

The sorting type.

Source

pub fn maybe_sorting( self, value: Option<SortingType>, ) -> SearchRequestBuilder<SetSorting<S>>
where S::Sorting: IsUnset,

Optional (Some / Option setters).

The sorting type.

Source

pub fn order(self, value: SortingOrder) -> SearchRequestBuilder<SetOrder<S>>
where S::Order: IsUnset,

Optional (Some / Option setters).

The sorting order

Source

pub fn maybe_order( self, value: Option<SortingOrder>, ) -> SearchRequestBuilder<SetOrder<S>>
where S::Order: IsUnset,

Optional (Some / Option setters).

The sorting order

Source

pub fn toplist_range( self, value: ToplistRange, ) -> SearchRequestBuilder<SetToplistRange<S>>
where S::ToplistRange: IsUnset,

Optional (Some / Option setters).

The toplist range.

Sorting MUST be set to SortingType::Toplist

Source

pub fn maybe_toplist_range( self, value: Option<ToplistRange>, ) -> SearchRequestBuilder<SetToplistRange<S>>
where S::ToplistRange: IsUnset,

Optional (Some / Option setters).

The toplist range.

Sorting MUST be set to SortingType::Toplist

Source

pub fn at_least(self, value: Resolution) -> SearchRequestBuilder<SetAtLeast<S>>
where S::AtLeast: IsUnset,

Optional (Some / Option setters).

Minimum resolution allowed

Source

pub fn maybe_at_least( self, value: Option<Resolution>, ) -> SearchRequestBuilder<SetAtLeast<S>>
where S::AtLeast: IsUnset,

Optional (Some / Option setters).

Minimum resolution allowed

Source

pub fn resolutions( self, value: Vec<Resolution>, ) -> SearchRequestBuilder<SetResolutions<S>>
where S::Resolutions: IsUnset,

Optional (Some / Option setters).

List of exact wallpaper resolutions

Source

pub fn maybe_resolutions( self, value: Option<Vec<Resolution>>, ) -> SearchRequestBuilder<SetResolutions<S>>
where S::Resolutions: IsUnset,

Optional (Some / Option setters).

List of exact wallpaper resolutions

Source

pub fn ratios( self, value: Vec<AspectRatio>, ) -> SearchRequestBuilder<SetRatios<S>>
where S::Ratios: IsUnset,

Optional (Some / Option setters).

List of aspect ratios

Source

pub fn maybe_ratios( self, value: Option<Vec<AspectRatio>>, ) -> SearchRequestBuilder<SetRatios<S>>
where S::Ratios: IsUnset,

Optional (Some / Option setters).

List of aspect ratios

Source

pub fn color(self, value: Color) -> SearchRequestBuilder<SetColor<S>>
where S::Color: IsUnset,

Optional (Some / Option setters).

Search by color

Source

pub fn maybe_color( self, value: Option<Color>, ) -> SearchRequestBuilder<SetColor<S>>
where S::Color: IsUnset,

Optional (Some / Option setters).

Search by color

Source

pub fn page(self, value: u64) -> SearchRequestBuilder<SetPage<S>>
where S::Page: IsUnset,

Optional (Some / Option setters).

Pagination, from 1->inf

(Not actually infinite)

Source

pub fn maybe_page(self, value: Option<u64>) -> SearchRequestBuilder<SetPage<S>>
where S::Page: IsUnset,

Optional (Some / Option setters).

Pagination, from 1->inf

(Not actually infinite)

Source

pub fn seed(self, value: String) -> SearchRequestBuilder<SetSeed<S>>
where S::Seed: IsUnset,

Optional (Some / Option setters).

Optional seed for random results

Source

pub fn maybe_seed( self, value: Option<String>, ) -> SearchRequestBuilder<SetSeed<S>>
where S::Seed: IsUnset,

Optional (Some / Option setters).

Optional seed for random results

Source§

impl<S: IsComplete> SearchRequestBuilder<S>

Source

pub fn build(self) -> Result<SearchRequest, String>

Builds the request.

§Errors

Throws an error if toplist_range is set and sorting isn’t SortingType::Toplist

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> 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: 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: 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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