pub enum OwnedBlockHeader {
BeaconChain(OwnedBeaconChainHeader),
IntermediateShard(OwnedIntermediateShardHeader),
LeafShard(OwnedLeafShardHeader),
}Expand description
An owned version of BlockHeader.
It is correctly aligned in memory and well suited for sending and receiving over the network efficiently or storing in memory or on disk.
Variants§
BeaconChain(OwnedBeaconChainHeader)
Block header corresponds to the beacon chain
IntermediateShard(OwnedIntermediateShardHeader)
Block header corresponds to an intermediate shard
LeafShard(OwnedLeafShardHeader)
Block header corresponds to a leaf shard
Implementations§
Source§impl OwnedBlockHeader
impl OwnedBlockHeader
Sourcepub fn from_buffer(
buffer: SharedAlignedBuffer,
) -> Result<Self, SharedAlignedBuffer>
pub fn from_buffer( buffer: SharedAlignedBuffer, ) -> Result<Self, SharedAlignedBuffer>
Create an owned header from a buffer.
The shard kind of the header is that of the shard index in its prefix, see
BlockHeader::shard_kind_from_bytes().
Sourcepub fn buffer(&self) -> &SharedAlignedBuffer
pub fn buffer(&self) -> &SharedAlignedBuffer
Inner buffer block header contents
Sourcepub fn header(&self) -> BlockHeader<'_>
pub fn header(&self) -> BlockHeader<'_>
Get BlockHeader out of OwnedBlockHeader
Trait Implementations§
Source§impl Clone for OwnedBlockHeader
impl Clone for OwnedBlockHeader
Source§impl Debug for OwnedBlockHeader
impl Debug for OwnedBlockHeader
Source§impl From<OwnedBeaconChainHeader> for OwnedBlockHeader
impl From<OwnedBeaconChainHeader> for OwnedBlockHeader
Source§fn from(value: OwnedBeaconChainHeader) -> Self
fn from(value: OwnedBeaconChainHeader) -> Self
Converts to this type from the input type.
Source§impl From<OwnedIntermediateShardHeader> for OwnedBlockHeader
impl From<OwnedIntermediateShardHeader> for OwnedBlockHeader
Source§fn from(value: OwnedIntermediateShardHeader) -> Self
fn from(value: OwnedIntermediateShardHeader) -> Self
Converts to this type from the input type.
Source§impl From<OwnedLeafShardHeader> for OwnedBlockHeader
impl From<OwnedLeafShardHeader> for OwnedBlockHeader
Source§fn from(value: OwnedLeafShardHeader) -> Self
fn from(value: OwnedLeafShardHeader) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Forget for OwnedBlockHeader
impl Freeze for OwnedBlockHeaderwhere
*const ArcInner<Yoke<BeaconChainHeader<'static>, SharedAlignedBuffer>> is !null: Freeze,
PhantomData<Yoke<BeaconChainHeader<'static>, SharedAlignedBuffer>>: Freeze,
*const ArcInner<Yoke<IntermediateShardHeader<'static>, SharedAlignedBuffer>> is !null: Freeze,
PhantomData<Yoke<IntermediateShardHeader<'static>, SharedAlignedBuffer>>: Freeze,
*const ArcInner<Yoke<LeafShardHeader<'static>, SharedAlignedBuffer>> is !null: Freeze,
PhantomData<Yoke<LeafShardHeader<'static>, SharedAlignedBuffer>>: Freeze,
impl Move for OwnedBlockHeader
impl RefUnwindSafe for OwnedBlockHeaderwhere
Atomic<usize>: RefUnwindSafe,
NonZero<u32>: RefUnwindSafe,
NonZero<u16>: RefUnwindSafe,
OnceLock<BlockRoot>: RefUnwindSafe,
impl Send for OwnedBlockHeaderwhere
Arc<Yoke<BeaconChainHeader<'static>, SharedAlignedBuffer>>: Send,
Arc<Yoke<IntermediateShardHeader<'static>, SharedAlignedBuffer>>: Send,
Arc<Yoke<LeafShardHeader<'static>, SharedAlignedBuffer>>: Send,
impl Sync for OwnedBlockHeaderwhere
Arc<Yoke<BeaconChainHeader<'static>, SharedAlignedBuffer>>: Sync,
Arc<Yoke<IntermediateShardHeader<'static>, SharedAlignedBuffer>>: Sync,
Arc<Yoke<LeafShardHeader<'static>, SharedAlignedBuffer>>: Sync,
impl Unpin for OwnedBlockHeaderwhere
*const ArcInner<Yoke<BeaconChainHeader<'static>, SharedAlignedBuffer>> is !null: Unpin,
&'static BlockHeaderPrefix: Unpin,
&'static BlockHeaderResult: Unpin,
&'static BlockHeaderConsensusInfo: Unpin,
&'static BlockHeaderEd25519Seal: Unpin,
&'static Blake3Hash: Unpin,
NonZero<u32>: Unpin,
NonZero<u16>: Unpin,
&'static SuperSegmentRoot: Unpin,
&'static BlockHeaderPotParametersChange: Unpin,
&'static [u8]: Unpin,
Align4<u32>: Unpin,
*const u8 is !null: Unpin,
*const ArcInner<Yoke<IntermediateShardHeader<'static>, SharedAlignedBuffer>> is !null: Unpin,
&'static BlockHeaderBeaconChainInfo: Unpin,
*const ArcInner<Yoke<LeafShardHeader<'static>, SharedAlignedBuffer>> is !null: Unpin,
impl UnsafeUnpin for OwnedBlockHeaderwhere
*const ArcInner<Yoke<BeaconChainHeader<'static>, SharedAlignedBuffer>> is !null: UnsafeUnpin,
PhantomData<Yoke<BeaconChainHeader<'static>, SharedAlignedBuffer>>: UnsafeUnpin,
*const ArcInner<Yoke<IntermediateShardHeader<'static>, SharedAlignedBuffer>> is !null: UnsafeUnpin,
PhantomData<Yoke<IntermediateShardHeader<'static>, SharedAlignedBuffer>>: UnsafeUnpin,
*const ArcInner<Yoke<LeafShardHeader<'static>, SharedAlignedBuffer>> is !null: UnsafeUnpin,
PhantomData<Yoke<LeafShardHeader<'static>, SharedAlignedBuffer>>: UnsafeUnpin,
impl UnwindSafe for OwnedBlockHeaderwhere
Arc<Yoke<BeaconChainHeader<'static>, SharedAlignedBuffer>>: UnwindSafe,
Arc<Yoke<IntermediateShardHeader<'static>, SharedAlignedBuffer>>: UnwindSafe,
Arc<Yoke<LeafShardHeader<'static>, SharedAlignedBuffer>>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more