[][src]Struct codd::expression::Intersect

pub struct Intersect<T, L, R> where
    T: Tuple,
    L: Expression<T>,
    R: Expression<T>, 
{ /* fields omitted */ }

Evaluates to all tuples that are in its both left and right sub-expressions.

Example:

use codd::{Database, expression::Intersect};

let mut db = Database::new();
let r = db.add_relation::<i32>("R").unwrap();
let s = db.add_relation::<i32>("S").unwrap();

db.insert(&r, vec![0, 1, 2].into());
db.insert(&s, vec![2, 4].into());

let intersect = Intersect::new(&r, &s);

assert_eq!(vec![2], db.evaluate(&intersect).unwrap().into_tuples());

Implementations

impl<T, L, R> Intersect<T, L, R> where
    T: Tuple,
    L: Expression<T>,
    R: Expression<T>, 
[src]

pub fn new<IL, IR>(left: IL, right: IR) -> Self where
    IL: IntoExpression<T, L>,
    IR: IntoExpression<T, R>, 
[src]

Creates a new instance of Intersect for left ∩ right.

pub fn left(&self) -> &L[src]

Returns a reference to the left sub-expression.

pub fn right(&self) -> &R[src]

Returns a reference to the right sub-expression.

Trait Implementations

impl<T: Clone, L: Clone, R: Clone> Clone for Intersect<T, L, R> where
    T: Tuple,
    L: Expression<T>,
    R: Expression<T>, 
[src]

impl<T: Debug, L: Debug, R: Debug> Debug for Intersect<T, L, R> where
    T: Tuple,
    L: Expression<T>,
    R: Expression<T>, 
[src]

impl<T, L, R> Expression<T> for Intersect<T, L, R> where
    T: Tuple,
    L: Expression<T>,
    R: Expression<T>, 
[src]

impl<T: Tuple> From<Intersect<T, Mono<T>, Mono<T>>> for Mono<T>[src]

Auto Trait Implementations

impl<T, L, R> RefUnwindSafe for Intersect<T, L, R> where
    L: RefUnwindSafe,
    R: RefUnwindSafe,
    T: RefUnwindSafe

impl<T, L, R> Send for Intersect<T, L, R> where
    L: Send,
    R: Send,
    T: Send

impl<T, L, R> Sync for Intersect<T, L, R> where
    L: Sync,
    R: Sync,
    T: Sync

impl<T, L, R> Unpin for Intersect<T, L, R> where
    L: Unpin,
    R: Unpin,
    T: Unpin

impl<T, L, R> UnwindSafe for Intersect<T, L, R> where
    L: UnwindSafe,
    R: UnwindSafe,
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, E> IntoExpression<T, E> for E where
    E: Expression<T>,
    T: Tuple
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.