pub enum SpanExpression {
SpanTerm {
field: String,
value: String,
},
SpanNear {
field: String,
terms: Vec<String>,
slop: u32,
in_order: bool,
},
SpanNot {
include: Box<SpanExpression>,
exclude: Box<SpanExpression>,
},
SpanFirst {
query: Box<SpanExpression>,
end: u32,
},
}Expand description
Span-typed expression — the subset of queries that yield
(doc, start, end) span tuples and can be composed by span
operators (SpanFirst, SpanNot, SpanNear).
The parser produces this type for span_first.match and
span_not.include / exclude, so the AST makes it unrepresentable
to place a non-span query inside a span composition operator —
the mistake would require constructing an invalid enum variant,
which doesn’t type-check. This replaces runtime dispatch and
default-trait-error rejection in the engine.
Variants§
SpanTerm
Single term with position awareness.
SpanNear
Terms within slop positions, optionally ordered.
SpanNot
Include spans minus exclude spans (doc-level overlap in Luci).
SpanFirst
Spans ending at position ≤ end.
Trait Implementations§
Source§impl Clone for SpanExpression
impl Clone for SpanExpression
Source§fn clone(&self) -> SpanExpression
fn clone(&self) -> SpanExpression
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SpanExpression
impl Debug for SpanExpression
Source§impl PartialEq for SpanExpression
impl PartialEq for SpanExpression
Source§fn eq(&self, other: &SpanExpression) -> bool
fn eq(&self, other: &SpanExpression) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for SpanExpression
Auto Trait Implementations§
impl Freeze for SpanExpression
impl RefUnwindSafe for SpanExpression
impl Send for SpanExpression
impl Sync for SpanExpression
impl Unpin for SpanExpression
impl UnsafeUnpin for SpanExpression
impl UnwindSafe for SpanExpression
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more