#[non_exhaustive]pub enum InvalidQuery {
NoItems,
UnconstrainedItem,
EventType(InvalidEventType),
Tag(InvalidTag),
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NoItems
A query was built from zero items. The specification requires a query to
hold at least one item or to be the match-all query; use
Query::all for the latter.
UnconstrainedItem
A query item constrained neither types nor tags, and would therefore
match every event — which is Query::all’s job.
EventType(InvalidEventType)
One of the item’s event types was itself invalid.
Tag(InvalidTag)
One of the item’s tags was itself invalid.
This is what lets a command handler in a library crate build tags, items
and a query, propagate all three with ?, and still have one error type
— without a bespoke enum and without reaching for anyhow, which the
house style forbids in library code. The conversion direction is
unambiguous: a query can contain tags, and a tag cannot contain a query.
Trait Implementations§
Source§impl Clone for InvalidQuery
impl Clone for InvalidQuery
Source§impl Debug for InvalidQuery
impl Debug for InvalidQuery
Source§impl Display for InvalidQuery
impl Display for InvalidQuery
impl Eq for InvalidQuery
Source§impl Error for InvalidQuery
impl Error for InvalidQuery
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<!> for InvalidQuery
impl From<!> for InvalidQuery
Source§fn from(never: Infallible) -> Self
fn from(never: Infallible) -> Self
Lets QueryItem::new accept both &str (which
converts fallibly) and an already-built
EventType (which cannot fail).