Struct owoof::retrieve::Pattern [−][src]
pub struct Pattern<'a, V> {
pub entity: Either<Variable<'a>, V>,
pub attribute: Either<Variable<'a>, V>,
pub value: Either<Variable<'a>, V>,
}
Expand description
A data structure for specifying high-level constraints with NamedNetwork::add_pattern
.
Variable::Any
adds no constraint.Variable::Unify
constrains the field to the first occurrence of the variable.Either::Right
holds acrate::Value
orcrate::ValueRef
or something and will match that field to that value using equality.
FYI: entity
and attribute
should use crate::Entity
and crate::Attribute
respectively instead, but it’s a bit convenient for all the fields to be homogeneous or
whatever so you can add them to a Vec
or iterate over them or otherwise interact with them
all the same.
Can be parsed but must borrow the input string because Variable
s always borrow. See
crate::BorrowedParse
about that. Also requires the serde_json
feature to parse a Value
.
Fields
entity: Either<Variable<'a>, V>
attribute: Either<Variable<'a>, V>
value: Either<Variable<'a>, V>