Enum edn::query::Binding
[−]
[src]
pub enum Binding { BindScalar(Variable), BindColl(Variable), BindRel(Vec<VariableOrPlaceholder>), BindTuple(Vec<VariableOrPlaceholder>), }
Variants
BindScalar(Variable)
BindColl(Variable)
BindRel(Vec<VariableOrPlaceholder>)
BindTuple(Vec<VariableOrPlaceholder>)
Methods
impl Binding
[src]
impl Binding
pub fn variables(&self) -> Vec<Option<Variable>>
[src]
pub fn variables(&self) -> Vec<Option<Variable>>
Return each variable or None
, in order.
pub fn is_empty(&self) -> bool
[src]
pub fn is_empty(&self) -> bool
Return true
if no variables are bound, i.e., all binding entries are placeholders.
pub fn is_valid(&self) -> bool
[src]
pub fn is_valid(&self) -> bool
Return true
if no variable is bound twice, i.e., each binding entry is either a
placeholder or unique.
use edn::query::{Binding,Variable,VariableOrPlaceholder}; use std::rc::Rc; let v = Variable::from_valid_name("?foo"); let vv = VariableOrPlaceholder::Variable(v); let p = VariableOrPlaceholder::Placeholder; let e = Binding::BindTuple(vec![p.clone()]); let b = Binding::BindTuple(vec![p.clone(), vv.clone()]); let d = Binding::BindTuple(vec![vv.clone(), p, vv]); assert!(b.is_valid()); // One var, one placeholder: OK. assert!(!e.is_valid()); // Empty: not OK. assert!(!d.is_valid()); // Duplicate var: not OK.
Trait Implementations
impl Clone for Binding
[src]
impl Clone for Binding
fn clone(&self) -> Binding
[src]
fn clone(&self) -> Binding
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Debug for Binding
[src]
impl Debug for Binding
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Eq for Binding
[src]
impl Eq for Binding
impl PartialEq for Binding
[src]
impl PartialEq for Binding
fn eq(&self, __arg_0: &Binding) -> bool
[src]
fn eq(&self, __arg_0: &Binding) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Binding) -> bool
[src]
fn ne(&self, __arg_0: &Binding) -> bool
This method tests for !=
.
impl ContainsVariables for Binding
[src]
impl ContainsVariables for Binding
fn accumulate_mentioned_variables(&self, acc: &mut BTreeSet<Variable>)
[src]
fn accumulate_mentioned_variables(&self, acc: &mut BTreeSet<Variable>)
fn collect_mentioned_variables(&self) -> BTreeSet<Variable>
[src]
fn collect_mentioned_variables(&self) -> BTreeSet<Variable>