Trait sp_runtime::traits::Block[][src]

pub trait Block: Clone + Send + Sync + Codec + Eq + MaybeSerialize + Debug + MaybeMallocSizeOf + 'static {
    type Extrinsic: Member + Codec + Extrinsic + MaybeSerialize + MaybeMallocSizeOf;
    type Header: Header<Hash = Self::Hash> + MaybeMallocSizeOf;
    type Hash: Member + MaybeSerializeDeserialize + Debug + Hash + Ord + Copy + MaybeDisplay + Default + SimpleBitOps + Codec + AsRef<[u8]> + AsMut<[u8]> + MaybeMallocSizeOf;
    fn header(&self) -> &Self::Header;
fn extrinsics(&self) -> &[Self::Extrinsic]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
;
fn deconstruct(self) -> (Self::Header, Vec<Self::Extrinsic>);
fn new(header: Self::Header, extrinsics: Vec<Self::Extrinsic>) -> Self;
fn encode_from(
        header: &Self::Header,
        extrinsics: &[Self::Extrinsic]
    ) -> Vec<u8>; fn hash(&self) -> Self::Hash { ... } }
Expand description

Something which fulfills the abstract idea of a Substrate block. It has types for Extrinsic pieces of information as well as a Header.

You can get an iterator over each of the extrinsics and retrieve the header.

Associated Types

Type for extrinsics.

Header type.

Block hash type.

Required methods

Returns a reference to the header.

Returns a reference to the list of extrinsics.

Split the block into header and list of extrinsics.

Creates new block from header and extrinsics.

Creates an encoded block from the given header and extrinsics without requiring the creation of an instance.

Provided methods

Returns the hash of the block.

Implementors