pub struct OwnedLeafShardHeader { /* private fields */ }
Expand description
An owned version of LeafShardHeader
.
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 OwnedLeafShardHeader
impl OwnedLeafShardHeader
Sourcepub const MAX_ALLOCATION: u32 = 1_377u32
pub const MAX_ALLOCATION: u32 = 1_377u32
Max allocation needed by this header
Sourcepub fn from_parts(
prefix: &BlockHeaderPrefix,
result: &BlockHeaderResult,
consensus_info: &BlockHeaderConsensusInfo,
beacon_chain_info: &BlockHeaderBeaconChainInfo,
) -> OwnedLeafShardBlockHeaderUnsealed
pub fn from_parts( prefix: &BlockHeaderPrefix, result: &BlockHeaderResult, consensus_info: &BlockHeaderConsensusInfo, beacon_chain_info: &BlockHeaderBeaconChainInfo, ) -> OwnedLeafShardBlockHeaderUnsealed
Create new OwnedLeafShardHeader
from its parts
Sourcepub fn from_parts_into(
prefix: &BlockHeaderPrefix,
result: &BlockHeaderResult,
consensus_info: &BlockHeaderConsensusInfo,
beacon_chain_info: &BlockHeaderBeaconChainInfo,
buffer: &mut OwnedAlignedBuffer,
)
pub fn from_parts_into( prefix: &BlockHeaderPrefix, result: &BlockHeaderResult, consensus_info: &BlockHeaderConsensusInfo, beacon_chain_info: &BlockHeaderBeaconChainInfo, buffer: &mut OwnedAlignedBuffer, )
Create owned header from its parts and write it into provided buffer
Sourcepub fn from_header(header: LeafShardHeader<'_>) -> Self
pub fn from_header(header: LeafShardHeader<'_>) -> Self
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) -> LeafShardHeader<'_>
pub fn header(&self) -> LeafShardHeader<'_>
Get LeafShardHeader
out of OwnedLeafShardHeader
Trait Implementations§
Source§impl Clone for OwnedLeafShardHeader
impl Clone for OwnedLeafShardHeader
Source§fn clone(&self) -> OwnedLeafShardHeader
fn clone(&self) -> OwnedLeafShardHeader
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 OwnedLeafShardHeader
impl Debug for OwnedLeafShardHeader
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 Freeze for OwnedLeafShardHeader
impl RefUnwindSafe for OwnedLeafShardHeader
impl Send for OwnedLeafShardHeader
impl Sync for OwnedLeafShardHeader
impl Unpin for OwnedLeafShardHeader
impl UnwindSafe for OwnedLeafShardHeader
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