[][src]Struct cvrdt_exposition::one_way_boolean::OneWayBoolean

pub struct OneWayBoolean {
    pub flag: bool,
}

A boolean flag that, once true, can never revert to false

Examples

Example usage, including demonstrating some properties:

use cvrdt_exposition::{Grow, OneWayBoolean};
let mut x = OneWayBoolean::new(false);
x.add(());
assert_eq!(x.payload(), true);
assert_eq!(x.query(&()), true);
for payload in vec![true, false] {
    let y = OneWayBoolean::new(payload);
    assert_eq!(x.merge(&y).payload(), y.merge(&x).payload());
    assert!(y.le(&x));
}

Fields

flag: bool

The internal state of a OneWayBoolean is a single boolean flag

Trait Implementations

impl Clone for OneWayBoolean[src]

impl Debug for OneWayBoolean[src]

impl Grow for OneWayBoolean[src]

type Payload = bool

The internal state of our CvRDT; sufficient to build a new copy via new. Required to implement Eq for testing and verification. Read more

type Update = ()

Message to update our internal state

type Query = ()

Message to query the Value of our CvRDT

type Value = bool

The response to a Query

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.