pub trait GenericBlock<'a>{
type Header: GenericBlockHeader<'a>;
type Body: GenericBlockBody<'a>;
type Owned: GenericOwnedBlock<Block<'a> = Self>
where Self: 'a;
// Required methods
fn header(&self) -> Self::Header;
fn body(&self) -> Self::Body;
fn try_to_owned(self) -> Option<Self::Owned>;
}
Expand description
Generic block
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§
Sourcefn try_to_owned(self) -> Option<Self::Owned>
fn try_to_owned(self) -> Option<Self::Owned>
Turn into owned version
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.