pub struct Query<E: Queryable> { /* private fields */ }Expand description
The container and root for queries.
See the module documentation for a explanation.
Implementations§
Source§impl<E: Queryable> Query<E>
impl<E: Queryable> Query<E>
Sourcepub fn from_continuous_str(
user_state: &<E::KeyValue as QueryKeyValue>::UserState,
s: &str,
parse_mode: ParseMode,
) -> Result<Query<E>, Error<E>>
pub fn from_continuous_str( user_state: &<E::KeyValue as QueryKeyValue>::UserState, s: &str, parse_mode: ParseMode, ) -> Result<Query<E>, Error<E>>
Construct this Query from a continuous string. This will correctly split
the string according to shell splitting rules (i.e., it takes double
and single quotes into account). This is useful, if you only don’t
have a shell in between taking this string from your user. If your
already have a split string, use Query::from_slice.
§Errors
If the input does not parse as a Query.
Sourcepub fn from_slice<'a, T>(
user_state: &<E::KeyValue as QueryKeyValue>::UserState,
s: T,
parse_mode: ParseMode,
) -> Result<Query<E>, Error<E>>
pub fn from_slice<'a, T>( user_state: &<E::KeyValue as QueryKeyValue>::UserState, s: T, parse_mode: ParseMode, ) -> Result<Query<E>, Error<E>>
Construct this Query from an already split up string. This will assume
that similar parts are in one split (i.e., title:Nice AND status:open, should resolve to three distinct splits).
Only use this function if your input is already split up by something
like a UNIX shell. Otherwise, you can use
Query::from_continuous_str to supply a (correctly quoted)
string.
§Errors
If the input does not parse as a Query.
Sourcepub fn from_matcher(matcher: Matcher<E>) -> Self
pub fn from_matcher(matcher: Matcher<E>) -> Self
Construct this Query from a Matcher.
This is useful, if you need to construct a query or want to compose
multiple queries together (for example, after accessing matchers via Query::as_matcher).