pub trait GenericBlock<'a>{
type Header: GenericBlockHeader<'a>;
type Body: GenericBlockBody<'a>;
type Owned: GenericOwnedBlock<Block<'a> = Self>
where Self: 'a;
const SHARD_KIND: RealShardKind;
// Required methods
fn header(&self) -> &Self::Header;
fn body(&self) -> &Self::Body;
fn to_owned(self) -> Self::Owned;
}ⓘ This trait cannot be implemented outside
ab_core_primitives.Expand description
Generic block.
Can’t be implemented outside of this module, so that code generic over blocks can rely on the header corresponding to the body, like with concrete blocks.
Required Associated Constants§
Sourceconst SHARD_KIND: RealShardKind
const SHARD_KIND: RealShardKind
Shard kind
Required Associated Types§
Sourcetype Header: GenericBlockHeader<'a>
type Header: GenericBlockHeader<'a>
Block header type
Sourcetype Body: GenericBlockBody<'a>
type Body: GenericBlockBody<'a>
Block body type
Sourcetype Owned: GenericOwnedBlock<Block<'a> = Self>where
Self: 'a,
type Owned: GenericOwnedBlock<Block<'a> = Self>where
Self: 'a,
Owned block
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".