Struct crdt_rs::PSet
[−]
[src]
pub struct PSet<T> { /* fields omitted */ }
Implements a state based two-phase set
using two GSet
s
Methods
impl<T: Ord + Clone> PSet<T>
[src]
fn new() -> PSet<T>
Creates a new PSet
fn insert(&mut self, value: T) -> bool
Inserts an element of type T
into the
given PSet
. Returns true
if the element
was already in the set. Otherwise, it inserts
the element and returns false
fn remove(&mut self, value: T) -> bool
Removes the given element from the PSet
fn contains(&mut self, value: &T) -> bool
Checks if the given value of type T
is in
the set. If the check is successful, returns
true
. Otherwise returns false
fn contents(&mut self) -> Vec<T>
Returns the contents of the given set. This is equivalent to the set difference between the add set and the remove set
fn is_empty(&mut self) -> bool
Checks if the given PSet
is empty
fn len(&mut self) -> usize
Returns the length of the given PSet
fn union(&mut self, other: &PSet<T>) -> PSet<T>
Returns the set union between the given PSet
and
another PSet
as a PSet
fn intersection(&mut self, other: &PSet<T>) -> PSet<T>
Returns the set intersection between the given PSet
and
another PSet
as a PSet
fn difference(&mut self, other: &PSet<T>) -> PSet<T>
Returns the set difference between the given PSet
and
another PSet
as a PSet
Trait Implementations
impl<T: Clone> Clone for PSet<T>
[src]
fn clone(&self) -> PSet<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<T: Hash> Hash for PSet<T>
[src]
fn hash<__HT: Hasher>(&self, __arg_0: &mut __HT)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<T: Debug> Debug for PSet<T>
[src]
impl<T: Ord + Clone> FromIterator<T> for PSet<T>
[src]
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> PSet<T>
Creates a value from an iterator. Read more
impl<T: Ord + Clone> Extend<T> for PSet<T>
[src]
fn extend<Iter: IntoIterator<Item = T>>(&mut self, iter: Iter)
Extends a collection with the contents of an iterator. Read more