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 MAX_ALLOCATION: u32
pub const MAX_ALLOCATION: u32
Max allocation needed by this header
Sourcepub fn from_parts(
prefix: &BlockHeaderPrefix,
result: &BlockHeaderResult,
consensus_info: &BlockHeaderConsensusInfo,
beacon_chain_info: &BlockHeaderBeaconChainInfo,
leaf_shard_blocks_root: &Blake3Hash,
) -> Result<OwnedIntermediateShardHeaderUnsealed, BlockHeaderConsistencyError>
pub fn from_parts( prefix: &BlockHeaderPrefix, result: &BlockHeaderResult, consensus_info: &BlockHeaderConsensusInfo, beacon_chain_info: &BlockHeaderBeaconChainInfo, leaf_shard_blocks_root: &Blake3Hash, ) -> Result<OwnedIntermediateShardHeaderUnsealed, BlockHeaderConsistencyError>
Create a new OwnedIntermediateShardHeader from its parts.
Returns an error if the parts are not consistent with each other or with the shard kind.
Sourcepub fn from_parts_into<'a>(
prefix: &BlockHeaderPrefix,
result: &BlockHeaderResult,
consensus_info: &BlockHeaderConsensusInfo,
beacon_chain_info: &BlockHeaderBeaconChainInfo,
leaf_shard_blocks_root: &Blake3Hash,
buffer: &'a mut OwnedAlignedBuffer,
) -> Result<OwnedIntermediateShardHeaderUnsealedRef<'a>, OwnedIntermediateShardHeaderError>
pub fn from_parts_into<'a>( prefix: &BlockHeaderPrefix, result: &BlockHeaderResult, consensus_info: &BlockHeaderConsensusInfo, beacon_chain_info: &BlockHeaderBeaconChainInfo, leaf_shard_blocks_root: &Blake3Hash, buffer: &'a mut OwnedAlignedBuffer, ) -> Result<OwnedIntermediateShardHeaderUnsealedRef<'a>, OwnedIntermediateShardHeaderError>
Write a header from its parts into the provided buffer, after the bytes already there.
The length of the buffer must be a multiple of 8 for the header to parse.
Returns an error if the parts are not consistent with each other or with the shard kind.
The seal is not attached, the header in the buffer is complete only after
OwnedIntermediateShardHeaderUnsealedRef::with_seal() attaches it. Nothing is written
when an error is returned, otherwise the seal is guaranteed to fit.
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
Sourcepub fn header(&self) -> &IntermediateShardHeader<'_>
pub fn header(&self) -> &IntermediateShardHeader<'_>
Trait Implementations§
Source§impl Clone for OwnedIntermediateShardHeader
impl Clone for OwnedIntermediateShardHeader
Source§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
Source§impl GenericOwnedBlockHeader for OwnedIntermediateShardHeader
impl GenericOwnedBlockHeader for OwnedIntermediateShardHeader
Source§const SHARD_KIND: RealShardKind = RealShardKind::IntermediateShard
const SHARD_KIND: RealShardKind = RealShardKind::IntermediateShard
Source§type Header<'a> = IntermediateShardHeader<'a>
type Header<'a> = IntermediateShardHeader<'a>
Source§fn from_buffer(buffer: SharedAlignedBuffer) -> Result<Self, SharedAlignedBuffer>
fn from_buffer(buffer: SharedAlignedBuffer) -> Result<Self, SharedAlignedBuffer>
Auto Trait Implementations§
impl Forget for OwnedIntermediateShardHeader
impl Freeze for OwnedIntermediateShardHeader
impl RefUnwindSafe for OwnedIntermediateShardHeader
impl Send for OwnedIntermediateShardHeader
impl Sync for OwnedIntermediateShardHeader
impl Unpin for OwnedIntermediateShardHeader
impl UnsafeUnpin 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
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> ⓘ
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> ⓘ
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