[][src]Struct sdset::multi::Difference

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

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

Note that the difference is all the elements that are in the first slice but not in all the others.

Examples

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

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

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

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

Methods

impl<'a, T> Difference<'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 Difference<'a, T>[src]

fn into_set_buf(self) -> SetBuf<T>[src]

Create a SetBuf using the SetOperation::extend_vec method.

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

fn into_set_buf(self) -> SetBuf<T>[src]

Create a SetBuf using the SetOperation::extend_vec method.

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

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

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

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

Blanket Implementations

impl<T> From for T[src]

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

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

type Owned = T

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.