reth::api

Trait Block

pub trait Block:
    Send
    + Sync
    + Unpin
    + Clone
    + Default
    + Debug
    + PartialEq
    + Eq
    + InMemorySize
    + MaybeSerde
    + MaybeArbitrary {
    type Header: BlockHeader + 'static;
    type Body: Send + Sync + Unpin + 'static;

    // Required methods
    fn header(&self) -> &Self::Header;
    fn body(&self) -> &Self::Body;
}
Expand description

Abstraction of block data type.

Required Associated Types§

type Header: BlockHeader + 'static

Header part of the block.

type Body: Send + Sync + Unpin + 'static

The block’s body contains the transactions in the block.

Required Methods§

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

Returns reference to block header.

fn body(&self) -> &Self::Body

Returns reference to block body.

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.

Implementations on Foreign Types§

§

impl<'a, T> Block for &'a T
where T: 'a + Block + ?Sized, &'a T: Send + Sync + Unpin + Clone + Default + Debug + PartialEq + Eq + InMemorySize + MaybeSerde + MaybeArbitrary,

§

type Header = <T as Block>::Header

§

type Body = <T as Block>::Body

§

fn header(&self) -> &<&'a T as Block>::Header

§

fn body(&self) -> &<&'a T as Block>::Body

§

impl<T> Block for Arc<T>
where T: Block + ?Sized, Arc<T>: Send + Sync + Unpin + Clone + Default + Debug + PartialEq + Eq + InMemorySize + MaybeSerde + MaybeArbitrary,

§

type Header = <T as Block>::Header

§

type Body = <T as Block>::Body

§

fn header(&self) -> &<Arc<T> as Block>::Header

§

fn body(&self) -> &<Arc<T> as Block>::Body

Implementors§

§

impl Block for Block

§

impl<H, B> Block for SealedBlock<H, B>
where H: BlockHeader + 'static, B: BlockBody + 'static, SealedBlock<H, B>: Serialize + for<'a> Deserialize<'a>,

§

type Header = H

§

type Body = B