referrerpolicy=no-referrer-when-downgrade

Trait LazyBlock

pub trait LazyBlock:
    Sized
    + Debug
    + Encode
    + Decode {
    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§

type Extrinsic: LazyExtrinsic

Type for the decoded extrinsics.

type Header: Header

Header type.

Required Methods§

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

Returns a reference to the header.

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

Returns a mut reference to the header.

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§

§

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

§

type Extrinsic = Extrinsic

§

type Header = Header