[][src]Struct brb_dt_at2::bank::Bank

pub struct Bank<A: Ord + Hash> { /* fields omitted */ }

Implementations

impl<A: Ord + Hash + Debug + Clone> Bank<A>[src]

pub fn open_account(&self, owner: A, balance: Money) -> Op<A>[src]

pub fn initial_balance(&self, actor: &A) -> Money[src]

pub fn balance(&self, actor: &A) -> Money[src]

pub fn transfer(&self, from: A, to: A, amount: Money) -> Option<Op<A>>[src]

Trait Implementations

impl<A: Ord + Hash + Debug + Clone + 'static + Serialize> BRBDataType<A> for Bank<A>[src]

type Op = Op<A>

type ValidationError = ValidationError<A>

pub fn validate(
    &self,
    source: &A,
    op: &Self::Op
) -> Result<(), Self::ValidationError>
[src]

Protection against Byzantines

pub fn apply(&mut self, op: Self::Op)[src]

Executed once an op has been validated

impl<A: Clone + Ord + Hash> Clone for Bank<A>[src]

impl<A: Debug + Ord + Hash> Debug for Bank<A>[src]

impl<A: Eq + Ord + Hash> Eq for Bank<A>[src]

impl<A: PartialEq + Ord + Hash> PartialEq<Bank<A>> for Bank<A>[src]

impl<A: Ord + Hash> StructuralEq for Bank<A>[src]

impl<A: Ord + Hash> StructuralPartialEq for Bank<A>[src]

Auto Trait Implementations

impl<A> RefUnwindSafe for Bank<A> where
    A: RefUnwindSafe
[src]

impl<A> Send for Bank<A> where
    A: Send
[src]

impl<A> Sync for Bank<A> where
    A: Sync
[src]

impl<A> Unpin for Bank<A> where
    A: Unpin
[src]

impl<A> UnwindSafe for Bank<A> where
    A: RefUnwindSafe + UnwindSafe
[src]

Blanket Implementations

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

impl<T> BRBDT for T where
    T: BRBDataType<Actor>, 
[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> Same<T> for T

type Output = T

Should always be Self

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,