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>
impl<'a, S: RequestState> RequestBuilder<'a, S>
Sourcepub fn match_type(self, match_type: MatchType) -> Self
pub fn match_type(self, match_type: MatchType) -> Self
Set the match type of the request
Sourcepub fn match_prefix(self) -> Self
pub fn match_prefix(self) -> Self
Shorthand for match_type(MatchType::Prefix)
Sourcepub fn with_filter(self, filter: Filter<'a>) -> Self
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.
Sourcepub fn filter(self, field: Field, regex: &'a str) -> Self
pub fn filter(self, field: Field, regex: &'a str) -> Self
Shorthand for with_filter(Filter::new(...))
Sourcepub fn filter_inverted(self, field: Field, regex: &'a str) -> Self
pub fn filter_inverted(self, field: Field, regex: &'a str) -> Self
Shorthand for with_filter(Filter::inverted(...))
Source§impl<'a> RequestBuilder<'a, BasicRequest>
impl<'a> RequestBuilder<'a, BasicRequest>
Sourcepub fn with_field(self, field: Field) -> Self
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
Sourcepub fn collapse(self, field: Field) -> RequestBuilder<'a, GroupedRequest>
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>
impl<'a> RequestBuilder<'a, GroupedRequest>
Sourcepub fn with_field<F: RequestField>(self, field: F) -> Self
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