pub struct Union<T, L, R>{ /* private fields */ }
Expand description
Evaluates to the union of the tuples in its left
and right
sub-expressions.
Example:
use codd::{Database, expression::Union};
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 union = Union::new(&r, &s);
assert_eq!(vec![0, 1, 2, 4], db.evaluate(&union).unwrap().into_tuples());
Implementations§
Source§impl<T, L, R> Union<T, L, R>
impl<T, L, R> Union<T, L, R>
Sourcepub fn new<IL, IR>(left: IL, right: IR) -> Selfwhere
IL: IntoExpression<T, L>,
IR: IntoExpression<T, R>,
pub fn new<IL, IR>(left: IL, right: IR) -> Selfwhere
IL: IntoExpression<T, L>,
IR: IntoExpression<T, R>,
Creates a new instance of Union
corresponding to left ∪ right
.
Trait Implementations§
Source§impl<T, L, R> Expression<T> for Union<T, L, R>
impl<T, L, R> Expression<T> for Union<T, L, R>
Auto Trait Implementations§
impl<T, L, R> Freeze for Union<T, L, R>
impl<T, L, R> RefUnwindSafe for Union<T, L, R>
impl<T, L, R> Send for Union<T, L, R>
impl<T, L, R> Sync for Union<T, L, R>
impl<T, L, R> Unpin for Union<T, L, R>
impl<T, L, R> UnwindSafe for Union<T, L, R>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, E> IntoExpression<T, E> for Ewhere
T: Tuple,
E: Expression<T>,
impl<T, E> IntoExpression<T, E> for Ewhere
T: Tuple,
E: Expression<T>,
Source§fn into_expression(self) -> E
fn into_expression(self) -> E
Consumes the receiver and returns an expression.