LazyBlock

Trait LazyBlock 

Source
pub trait LazyBlock:
    Debug
    + Encode
    + Decode
    + Sized {
    type Extrinsic: LazyExtrinsic;
    type Header: Header;

    // Required methods
    fn header(&self) -> &Self::Header;
    fn header_mut(&mut self) -> &mut Self::Header;
    fn extrinsics(&self) -> impl Iterator<Item = Result<Self::Extrinsic, Error>>;
}
Expand description

A Substrate block that allows us to lazily decode its extrinsics.

Required Associated Types§

Source

type Extrinsic: LazyExtrinsic

Type for the decoded extrinsics.

Source

type Header: Header

Header type.

Required Methods§

Source

fn header(&self) -> &Self::Header

Returns a reference to the header.

Source

fn header_mut(&mut self) -> &mut Self::Header

Returns a mut reference to the header.

Source

fn extrinsics(&self) -> impl Iterator<Item = Result<Self::Extrinsic, Error>>

Returns an iterator over all extrinsics.

The extrinsics are lazily decoded (if possible) as they are pulled by the iterator.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<Header, Extrinsic> LazyBlock for LazyBlock<Header, Extrinsic>
where Header: HeaderT, Extrinsic: Debug + LazyExtrinsic,

Source§

type Extrinsic = Extrinsic

Source§

type Header = Header