pub struct PNCounter { /* private fields */ }Expand description
A counter that can be incremented and decremented.
The value is the difference between total increments and total decrements. Each replica maintains its own increment and decrement counts.
Implementations§
Source§impl PNCounter
impl PNCounter
Sourcepub fn with_replica_id(id: ReplicaId) -> Self
pub fn with_replica_id(id: ReplicaId) -> Self
Create a counter with a specific replica ID.
Sourcepub fn replica_id(&self) -> ReplicaId
pub fn replica_id(&self) -> ReplicaId
Get the replica ID for this counter.
Trait Implementations§
Source§impl DeltaCrdt for PNCounter
impl DeltaCrdt for PNCounter
Source§impl<'de> Deserialize<'de> for PNCounter
impl<'de> Deserialize<'de> for PNCounter
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq<i64> for PNCounter
Allow comparing PNCounter to integers for ergonomic conditionals
impl PartialEq<i64> for PNCounter
Allow comparing PNCounter to integers for ergonomic conditionals
impl StructuralPartialEq for PNCounter
Auto Trait Implementations§
impl Freeze for PNCounter
impl RefUnwindSafe for PNCounter
impl Send for PNCounter
impl Sync for PNCounter
impl Unpin for PNCounter
impl UnsafeUnpin for PNCounter
impl UnwindSafe for PNCounter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more