Enum stam::Constraint
source · pub enum Constraint<'a> {
Show 24 variants
Id(&'a str),
Annotation(&'a str, SelectionQualifier, AnnotationDepth, Option<Offset>),
TextResource(&'a str, SelectionQualifier, Option<Offset>),
DataSet(&'a str, SelectionQualifier),
DataKey {
set: &'a str,
key: &'a str,
qualifier: SelectionQualifier,
},
KeyVariable(&'a str, SelectionQualifier),
DataVariable(&'a str, SelectionQualifier),
DataSetVariable(&'a str, SelectionQualifier),
ResourceVariable(&'a str, SelectionQualifier, Option<Offset>),
TextVariable(&'a str),
TextRelation {
var: &'a str,
operator: TextSelectionOperator,
},
KeyValue {
set: &'a str,
key: &'a str,
operator: DataOperator<'a>,
qualifier: SelectionQualifier,
},
Value(DataOperator<'a>, SelectionQualifier),
KeyValueVariable(&'a str, DataOperator<'a>, SelectionQualifier),
Text(&'a str, TextMode),
Regex(Regex),
Union(Vec<Constraint<'a>>),
AnnotationVariable(&'a str, SelectionQualifier, AnnotationDepth, Option<Offset>),
Annotations(Handles<'a, Annotation>, SelectionQualifier, AnnotationDepth),
Data(Handles<'a, AnnotationData>, SelectionQualifier),
Keys(Handles<'a, DataKey>, SelectionQualifier),
Resources(Handles<'a, TextResource>, SelectionQualifier),
TextSelections(Handles<'a, TextSelection>, SelectionQualifier),
Limit {
begin: isize,
end: isize,
},
}Expand description
Variants§
Id(&'a str)
Constrain the selection (type is determined by the query result type) to one instance with a specific identifier (ID keyword in STAMQL).
Annotation(&'a str, SelectionQualifier, AnnotationDepth, Option<Offset>)
Constrain by a specific Annotation, referenced by ID (ANNOTATION keyword in STAMQL)
TextResource(&'a str, SelectionQualifier, Option<Offset>)
Constrain by a specific TextResource, referenced by ID (RESOURCE keyword in STAMQL)
DataSet(&'a str, SelectionQualifier)
Constrain by a specific AnnotationDataSet, referenced by ID (DATASET keyword in STAMQL)
DataKey
Constrain by a specific DataKey, referenced by set and key ID (DATA keyword, without operator/value, in STAMQL)
KeyVariable(&'a str, SelectionQualifier)
Constrain by a specific DataKey, referenced by variable (KEY keyword in STAMQL), the variable name must not carry the ? prefix here.
DataVariable(&'a str, SelectionQualifier)
Constrain by a specific AnnotationData, referenced by variable (DATA keyword in STAMQL), the variable name must not carry the ? prefix here.
DataSetVariable(&'a str, SelectionQualifier)
Constrain by a specific AnnotationDataSet, referenced by variable (DATASET keyword in STAMQL), the variable name must not carry the ? prefix here.
ResourceVariable(&'a str, SelectionQualifier, Option<Offset>)
Constrain by a specific TextResource, referenced by variable (RESOURCE keyword in STAMQL), the variable name must not carry the ? prefix here.
TextVariable(&'a str)
Constrain by a specific text selection, referenced by variable (TEXT keyword in STAMQL), the variable name must not carry the ? prefix here.
TextRelation
Constrain by a specific text selection and a particular relation textual relation (RELATION keyword in STAMQL), the text selection is referenced by variable (TEXT keyword in STAMQL), the variable name must not carry the ? prefix here.
KeyValue
Constrain by a specific DataKey and value, referenced by set and key ID, and a DataOperator (DATA keyword in STAMQL)
Value(DataOperator<'a>, SelectionQualifier)
Constrain by a specific value (VALUE keyword, with operator/value, in STAMQL). This only makes sense in certain contexts like when querying keys.
KeyValueVariable(&'a str, DataOperator<'a>, SelectionQualifier)
Constrain by a specific DataKey and value test DataOperator, only the key is referenced by variable, the variable name must not carry the ? prefix here.
Text(&'a str, TextMode)
Constrain by textual content (TEXT keyword in STAMQL). The TextMode determines whether comparisons are exact or case-insensitive (TEXT AS NOCASE in STAMQL). See also Constraint::Regex
Regex(Regex)
Constrain by textual content via a regular expression (TEXT AS REGEX keyword in STAMQL)
Union(Vec<Constraint<'a>>)
Disjunction
AnnotationVariable(&'a str, SelectionQualifier, AnnotationDepth, Option<Offset>)
Constrain by a specific Annotation, referenced by variable (Annotation keyword in STAMQL), the variable name must not carry the ? prefix here.
Annotations(Handles<'a, Annotation>, SelectionQualifier, AnnotationDepth)
Constrain by any of multiple annotations
Data(Handles<'a, AnnotationData>, SelectionQualifier)
Constrain by any of multiple annotation data
Keys(Handles<'a, DataKey>, SelectionQualifier)
Constrain by any of multiple data keys
Resources(Handles<'a, TextResource>, SelectionQualifier)
Constrain by any of multiple resources
TextSelections(Handles<'a, TextSelection>, SelectionQualifier)
Constrain by any of multiple text selections
Limit
Constrain to a certain range
Implementations§
Trait Implementations§
source§impl<'a> Clone for Constraint<'a>
impl<'a> Clone for Constraint<'a>
source§fn clone(&self) -> Constraint<'a>
fn clone(&self) -> Constraint<'a>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<'a> Freeze for Constraint<'a>
impl<'a> RefUnwindSafe for Constraint<'a>
impl<'a> Send for Constraint<'a>
impl<'a> Sync for Constraint<'a>
impl<'a> Unpin for Constraint<'a>
impl<'a> UnwindSafe for Constraint<'a>
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
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>
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>
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