Struct RequestBuilder

Source
pub struct RequestBuilder<'a, S: RequestState> { /* private fields */ }
Expand description

Struct implementing the builder & typestate patterns for creating a request

Implementations§

Source§

impl<'a, S: RequestState> RequestBuilder<'a, S>

Source

pub fn done(self) -> Request<'a>

Drop the builder and extract the finished request.

Source

pub fn match_type(self, match_type: MatchType) -> Self

Set the match type of the request

Source

pub fn match_prefix(self) -> Self

Shorthand for match_type(MatchType::Prefix)

Source

pub fn output(self, output: Output) -> Self

Set the output format of the request

Source

pub fn with_filter(self, filter: Filter<'a>) -> Self

Add a filter to be applied to the whole set of entries before any grouping takes place

Normal filters are requirements, inverted filters exclude matching results.

Source

pub fn filter(self, field: Field, regex: &'a str) -> Self

Shorthand for with_filter(Filter::new(...))

Source

pub fn filter_inverted(self, field: Field, regex: &'a str) -> Self

Shorthand for with_filter(Filter::inverted(...))

Source§

impl<'a> RequestBuilder<'a, BasicRequest>

Source

pub fn new(url: &'a str) -> Self

Create a new basic request

Source

pub fn with_field(self, field: Field) -> Self

Explicitly add a Field to the list of fields in the result.

Fields can be added multiple times. When no field is added to a request, the server chooses a default set of fields

Source

pub fn collapse(self, field: Field) -> RequestBuilder<'a, GroupedRequest>

Collapse the result set by grouping entries for which the given field has the same value.

This is generally used to group results by UrlKey

Source§

impl<'a> RequestBuilder<'a, GroupedRequest>

Source

pub fn with_field<F: RequestField>(self, field: F) -> Self

Explicitly add a Field or GroupField to the list of fields in the result.

Fields can be added multiple times. When no field is added to a request, the server chooses a default set of fields

Auto Trait Implementations§

§

impl<'a, S> Freeze for RequestBuilder<'a, S>

§

impl<'a, S> RefUnwindSafe for RequestBuilder<'a, S>
where S: RefUnwindSafe,

§

impl<'a, S> Send for RequestBuilder<'a, S>
where S: Send,

§

impl<'a, S> Sync for RequestBuilder<'a, S>
where S: Sync,

§

impl<'a, S> Unpin for RequestBuilder<'a, S>
where S: Unpin,

§

impl<'a, S> UnwindSafe for RequestBuilder<'a, S>
where S: UnwindSafe,

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, 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, 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.