Skip to main content

GenericOwnedBlock

Trait GenericOwnedBlock 

Source
pub trait GenericOwnedBlock:
    Clone
    + Debug
    + Send
    + Sync
    + Into<OwnedBlock>
    + Any
    + 'static {
    type Header: GenericOwnedBlockHeader;
    type Body: GenericOwnedBlockBody;
    type Block<'a>: GenericBlock<'a>
       where Self: 'a;

    const SHARD_KIND: RealShardKind;

    // Required methods
    fn split(self) -> (Self::Header, Self::Body);
    fn header(&self) -> &Self::Header;
    fn body(&self) -> &Self::Body;
    fn from_buffers(
        header: SharedAlignedBuffer,
        body: SharedAlignedBuffer,
    ) -> Option<Self>;
    fn block(&self) -> Self::Block<'_>;
}
Expand description

Generic owned block

Required Associated Constants§

Required Associated Types§

Source

type Header: GenericOwnedBlockHeader

Block header type

Source

type Body: GenericOwnedBlockBody

Block body type

Source

type Block<'a>: GenericBlock<'a> where Self: 'a

Block

Required Methods§

Source

fn split(self) -> (Self::Header, Self::Body)

Split into header and body

Source

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

Block header

Source

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

Block body

Source

fn from_buffers( header: SharedAlignedBuffer, body: SharedAlignedBuffer, ) -> Option<Self>

Create owned block from buffers

Source

fn block(&self) -> Self::Block<'_>

Get regular block out of the owned version

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§