Struct crdts::orswot::Orswot
[−]
[src]
pub struct Orswot<Member: Ord + Clone, Actor: Ord + Clone> { // some fields omitted }
Orswot
is an add-biased or-set without tombstones ported from
the riak_dt CRDT library.
Methods
impl<Member: Ord + Clone, Actor: Ord + Clone> Orswot<Member, Actor>
[src]
fn new() -> Orswot<Member, Actor>
Returns a new Orswot
instance.
fn add(&mut self, member: Member, actor: Actor)
Add a single element.
Safety
add
should never be passed identical actor
arguments
for different replicas. This will result in data loss:
use crdts::Orswot; let (mut a, mut b) = (Orswot::new(), Orswot::new()); a.add(1, 1); b.add(2, 1); a.merge(b); assert!(a.value().is_empty());
fn add_all(&mut self, members: Vec<Member>, actor: Actor)
Add several members.
fn remove(&mut self, member: Member) -> Option<VClock<Actor>>
Remove a member without providing a witnessing context.
Returns an existing context VClock
if it was present.
fn remove_with_context(&mut self, member: Member, context: &VClock<Actor>)
Remove a member using a witnessing context.
fn remove_all(&mut self, members: Vec<Member>) -> Vec<Option<VClock<Actor>>>
Remove multiple members, without providing a witnessing context.
fn remove_all_with_context(&mut self, members: Vec<Member>, context: &VClock<Actor>)
Remove multiple members with a witnessing context.
fn value(&self) -> Vec<Member>
Retrieve the current members.
fn merge(&mut self, other: Orswot<Member, Actor>)
Merge combines another Orswot
with this one.
fn precondition_context(&self) -> VClock<Actor>
Returns the current VClock
associated with this Orswot
.
Trait Implementations
impl<Member: Hash + Ord + Clone, Actor: Hash + Ord + Clone> Hash for Orswot<Member, Actor>
[src]
fn hash<__HMemberActor: Hasher>(&self, __arg_0: &mut __HMemberActor)
Feeds this value into the state given, updating the hasher as necessary.
fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0
Feeds a slice of this type into the state provided.
impl<Member: Eq + Ord + Clone, Actor: Eq + Ord + Clone> Eq for Orswot<Member, Actor>
[src]
impl<Member: PartialEq + Ord + Clone, Actor: PartialEq + Ord + Clone> PartialEq for Orswot<Member, Actor>
[src]
fn eq(&self, __arg_0: &Orswot<Member, Actor>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Orswot<Member, Actor>) -> bool
This method tests for !=
.
impl<Member: PartialOrd + Ord + Clone, Actor: PartialOrd + Ord + Clone> PartialOrd for Orswot<Member, Actor>
[src]
fn partial_cmp(&self, __arg_0: &Orswot<Member, Actor>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &Orswot<Member, Actor>) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &Orswot<Member, Actor>) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &Orswot<Member, Actor>) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &Orswot<Member, Actor>) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<Member: Ord + Ord + Clone, Actor: Ord + Ord + Clone> Ord for Orswot<Member, Actor>
[src]
fn cmp(&self, __arg_0: &Orswot<Member, Actor>) -> Ordering
This method returns an Ordering
between self
and other
. Read more
impl<Member: Clone + Ord + Clone, Actor: Clone + Ord + Clone> Clone for Orswot<Member, Actor>
[src]
fn clone(&self) -> Orswot<Member, Actor>
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