pub struct QueryInputs { /* private fields */ }Expand description
Define the inputs to a query. This is in two parts: a set of values known now, and a set of
types known now.
The separate map of types is to allow queries to be algebrized without full knowledge of
the bindings that will be used at execution time.
When built correctly, types is guaranteed to contain the types of values – use
QueryInputs::new or QueryInputs::with_values to construct an instance.
Implementations§
Source§impl QueryInputs
impl QueryInputs
pub fn with_value_sequence(vals: Vec<(Variable, TypedValue)>) -> QueryInputs
pub fn with_type_sequence(types: Vec<(Variable, ValueType)>) -> QueryInputs
pub fn with_values(values: BTreeMap<Variable, TypedValue>) -> QueryInputs
Sourcepub fn with_collection(var: Variable, values: Vec<TypedValue>) -> QueryInputs
pub fn with_collection(var: Variable, values: Vec<TypedValue>) -> QueryInputs
Bind a single variable to a collection of values (:in $ [?x ...]).
Sourcepub fn with_tuple(vars: Vec<Variable>, values: Vec<TypedValue>) -> QueryInputs
pub fn with_tuple(vars: Vec<Variable>, values: Vec<TypedValue>) -> QueryInputs
Bind several variables to one row of values (:in $ [?a ?b]).
Sourcepub fn with_relation(
vars: Vec<Variable>,
rows: Vec<Vec<TypedValue>>,
) -> QueryInputs
pub fn with_relation( vars: Vec<Variable>, rows: Vec<Vec<TypedValue>>, ) -> QueryInputs
Bind several variables to a table of rows (:in $ [[?a ?b]]).
Sourcepub fn merge(self, other: QueryInputs) -> Result<QueryInputs, AlgebrizerError>
pub fn merge(self, other: QueryInputs) -> Result<QueryInputs, AlgebrizerError>
Combine two sets of inputs, e.g. scalars from with_value_sequence plus a
collection from with_collection, for :in ?name [?x ...]. Fails if a
variable is bound by both, or bound twice with different types.
pub fn new( types: BTreeMap<Variable, ValueType>, values: BTreeMap<Variable, TypedValue>, ) -> Result<QueryInputs, AlgebrizerError>
Trait Implementations§
Source§impl Default for QueryInputs
impl Default for QueryInputs
Source§fn default() -> QueryInputs
fn default() -> QueryInputs
Auto Trait Implementations§
impl !Send for QueryInputs
impl !Sync for QueryInputs
impl Freeze for QueryInputs
impl RefUnwindSafe for QueryInputs
impl Unpin for QueryInputs
impl UnsafeUnpin for QueryInputs
impl UnwindSafe for QueryInputs
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