pub trait Decidable {
    // Required methods
    fn id<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Id> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn status<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Status> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn accept<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn reject<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Required Methods§

source

fn id<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Id> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Returns a unique ID for this element.

Typically, this is implemented by using a cryptographic hash of a binary representation of this element. An element should return the same IDs upon repeated calls.

source

fn status<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Status> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Status returns this element’s current status.

If Accept has been called on an element with this ID, Accepted should be returned. Similarly, if Reject has been called on an element with this ID, Rejected should be returned. If the contents of this element are unknown, then Unknown should be returned. Otherwise, Processing should be returned.

source

fn accept<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Accept this element.

This element will be accepted by every correct node in the network.

source

fn reject<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Rejects this element.

This element will not be accepted by any correct node in the network.

Implementors§