pub struct OwnedIntermediateShardHeader { /* private fields */ }
Expand description
An owned version of IntermediateShardHeader
.
It is correctly aligned in memory and well suited for sending and receiving over the network efficiently or storing in memory or on disk.
Implementations§
Source§impl OwnedIntermediateShardHeader
impl OwnedIntermediateShardHeader
Sourcepub const fn max_allocation_for(child_shard_blocks: &[BlockRoot]) -> u32
pub const fn max_allocation_for(child_shard_blocks: &[BlockRoot]) -> u32
Max allocation needed by this header
Sourcepub fn from_parts(
prefix: &BlockHeaderPrefix,
result: &BlockHeaderResult,
consensus_info: &BlockHeaderConsensusInfo,
beacon_chain_info: &BlockHeaderBeaconChainInfo,
child_shard_blocks: &[BlockRoot],
) -> Result<OwnedIntermediateShardBlockHeaderUnsealed, OwnedIntermediateShardHeaderError>
pub fn from_parts( prefix: &BlockHeaderPrefix, result: &BlockHeaderResult, consensus_info: &BlockHeaderConsensusInfo, beacon_chain_info: &BlockHeaderBeaconChainInfo, child_shard_blocks: &[BlockRoot], ) -> Result<OwnedIntermediateShardBlockHeaderUnsealed, OwnedIntermediateShardHeaderError>
Create new OwnedIntermediateShardHeader
from its parts
Sourcepub fn from_parts_into(
prefix: &BlockHeaderPrefix,
result: &BlockHeaderResult,
consensus_info: &BlockHeaderConsensusInfo,
beacon_chain_info: &BlockHeaderBeaconChainInfo,
child_shard_blocks: &[BlockRoot],
buffer: &mut OwnedAlignedBuffer,
) -> Result<(), OwnedIntermediateShardHeaderError>
pub fn from_parts_into( prefix: &BlockHeaderPrefix, result: &BlockHeaderResult, consensus_info: &BlockHeaderConsensusInfo, beacon_chain_info: &BlockHeaderBeaconChainInfo, child_shard_blocks: &[BlockRoot], buffer: &mut OwnedAlignedBuffer, ) -> Result<(), OwnedIntermediateShardHeaderError>
Create owned header from its parts and write it into provided buffer
Sourcepub fn from_header(
header: IntermediateShardHeader<'_>,
) -> Result<Self, OwnedIntermediateShardHeaderError>
pub fn from_header( header: IntermediateShardHeader<'_>, ) -> Result<Self, OwnedIntermediateShardHeaderError>
Create owned block header from a reference
Sourcepub fn from_buffer(
buffer: SharedAlignedBuffer,
) -> Result<Self, SharedAlignedBuffer>
pub fn from_buffer( buffer: SharedAlignedBuffer, ) -> Result<Self, SharedAlignedBuffer>
Create owned header from a buffer
Sourcepub fn buffer(&self) -> &SharedAlignedBuffer
pub fn buffer(&self) -> &SharedAlignedBuffer
Inner buffer with block header contents
Sourcepub fn header(&self) -> IntermediateShardHeader<'_>
pub fn header(&self) -> IntermediateShardHeader<'_>
Trait Implementations§
Source§impl Clone for OwnedIntermediateShardHeader
impl Clone for OwnedIntermediateShardHeader
Source§fn clone(&self) -> OwnedIntermediateShardHeader
fn clone(&self) -> OwnedIntermediateShardHeader
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for OwnedIntermediateShardHeader
impl Debug for OwnedIntermediateShardHeader
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.
Auto Trait Implementations§
impl Freeze for OwnedIntermediateShardHeader
impl RefUnwindSafe for OwnedIntermediateShardHeader
impl Send for OwnedIntermediateShardHeader
impl Sync for OwnedIntermediateShardHeader
impl Unpin for OwnedIntermediateShardHeader
impl UnwindSafe for OwnedIntermediateShardHeader
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