Enum edn::query::Binding [] [src]

pub enum Binding {
    BindScalar(Variable),
    BindColl(Variable),
    BindRel(Vec<VariableOrPlaceholder>),
    BindTuple(Vec<VariableOrPlaceholder>),
}

Variants

Methods

impl Binding
[src]

Important traits for Vec<u8>

Return each variable or None, in order.

Return true if no variables are bound, i.e., all binding entries are placeholders.

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]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Binding
[src]

Formats the value using the given formatter. Read more

impl Eq for Binding
[src]

impl PartialEq for Binding
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl ContainsVariables for Binding
[src]

Auto Trait Implementations

impl !Send for Binding

impl !Sync for Binding