pub trait Block: Decidable + Initializer + StatusWriter + Sync + Send {
    // Required methods
    fn bytes<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = &[u8]> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn to_bytes<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn height<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = u64> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn timestamp<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = u64> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn parent<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Id> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn verify<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

ref.https://pkg.go.dev/github.com/ava-labs/avalanchego/snow/consensus/snowman#Block

Required Methods§

source

fn bytes<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = &[u8]> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Returns the bytes of this block.

source

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

Returns bytes from serde.

source

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

Returns the height of the block in the chain.

source

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

Returns the creation timestamp of the block in the chain.

source

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

Returns the ID of this block’s parent.

source

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

Returns error if the block can not be verified.

Implementors§