[][src]Struct sdset::multi::Intersection

pub struct Intersection<'a, T: 'a> { /* fields omitted */ }

Represent the intersection set operation that will be applied to the slices.

Note that the intersection is all the elements that are in all the slices at the same time.

Examples

use sdset::multi::OpBuilder;
use sdset::{SetOperation, Set, SetBuf};

let a = Set::new(&[1, 2, 4])?;
let b = Set::new(&[2, 3, 4, 5, 7])?;
let c = Set::new(&[2, 4, 6, 7])?;

let op = OpBuilder::from_vec(vec![a, b, c]).intersection();

let res: SetBuf<i32> = op.into_set_buf();
assert_eq!(&res[..], &[2, 4]);

Methods

impl<'a, T> Intersection<'a, T>[src]

pub fn new(slices: Vec<&'a Set<T>>) -> Self[src]

Construct one with slices checked to be sorted and deduplicated.

Trait Implementations

impl<'a, T: Ord + Clone> SetOperation<T> for Intersection<'a, T>[src]

impl<'a, T: Ord> SetOperation<&'a T> for Intersection<'a, T>[src]

impl<'a, T: Clone + 'a> Clone for Intersection<'a, T>[src]

Auto Trait Implementations

impl<'a, T> Send for Intersection<'a, T> where
    T: Sync

impl<'a, T> Sync for Intersection<'a, T> where
    T: Sync

impl<'a, T> Unpin for Intersection<'a, T>

impl<'a, T> UnwindSafe for Intersection<'a, T> where
    T: RefUnwindSafe

impl<'a, T> RefUnwindSafe for Intersection<'a, T> where
    T: RefUnwindSafe

Blanket Implementations

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[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 = !

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.

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

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

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