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]
pub fn variables(&self) -> Vec<Option<Variable>>
[src]
Return each variable or None
, in order.
pub fn is_empty(&self) -> bool
[src]
Return true
if no variables are bound, i.e., all binding entries are placeholders.
pub fn is_valid(&self) -> bool
[src]
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]
fn clone(&self) -> Binding
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Binding
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Eq for Binding
[src]
impl PartialEq for Binding
[src]
fn eq(&self, __arg_0: &Binding) -> bool
[src]
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]
This method tests for !=
.