Trait protocoll::Set
[−]
[src]
pub trait Set<T> where
Self: Sized, { fn fun<'a, Q: ?Sized>(&'a self) -> Box<Fn(&Q) -> Option<&'a T> + 'a>
where
T: Borrow<Q>,
Q: Hash + Ord; fn inc(self, i: T) -> Self; fn dec<Q: ?Sized>(self, i: &Q) -> Self
where
T: Borrow<Q>,
Q: Hash + Ord; fn zero(self) -> Self; fn shrink(self) -> Self; fn plus<I>(self, coll: I) -> Self
where
I: IntoIterator<Item = T>, { ... } }
basic protocol for sets.
Required Methods
fn fun<'a, Q: ?Sized>(&'a self) -> Box<Fn(&Q) -> Option<&'a T> + 'a> where
T: Borrow<Q>,
Q: Hash + Ord,
T: Borrow<Q>,
Q: Hash + Ord,
a set maps from items to themselves.
fn inc(self, i: T) -> Self
adds item i
.
like clojure
's conj
.
fn dec<Q: ?Sized>(self, i: &Q) -> Self where
T: Borrow<Q>,
Q: Hash + Ord,
T: Borrow<Q>,
Q: Hash + Ord,
removes item i
.
like clojure
's disj
.
fn zero(self) -> Self
clear
.
fn shrink(self) -> Self
shrink_to_fit
.
Provided Methods
fn plus<I>(self, coll: I) -> Self where
I: IntoIterator<Item = T>,
I: IntoIterator<Item = T>,
pours another collection into this one.
like clojure
's into
.