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>
[src]

Return each variable or None, in order.

[src]

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

[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]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Binding
[src]

[src]

Formats the value using the given formatter. Read more

impl Eq for Binding
[src]

impl PartialEq for Binding
[src]

[src]

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

[src]

This method tests for !=.

impl ContainsVariables for Binding
[src]

[src]

[src]