pub struct OwnedBeaconChainBlock {
pub header: OwnedBeaconChainHeader,
pub body: OwnedBeaconChainBody,
}
Expand description
An owned version of BeaconChainBlock
.
It is correctly aligned in memory and well suited for sending and receiving over the network efficiently or storing in memory or on disk.
Fields§
§header: OwnedBeaconChainHeader
Block header
body: OwnedBeaconChainBody
Block body
Implementations§
Source§impl OwnedBeaconChainBlock
impl OwnedBeaconChainBlock
Sourcepub fn init<'a, ISB>(
own_segment_roots: &[SegmentRoot],
intermediate_shard_blocks: ISB,
pot_checkpoints: &[PotCheckpoints],
) -> Result<OwnedBeaconChainBlockBuilder, OwnedBeaconChainBodyError>
pub fn init<'a, ISB>( own_segment_roots: &[SegmentRoot], intermediate_shard_blocks: ISB, pot_checkpoints: &[PotCheckpoints], ) -> Result<OwnedBeaconChainBlockBuilder, OwnedBeaconChainBodyError>
Initialize building of OwnedBeaconChainBlock
Sourcepub fn from_block(
block: BeaconChainBlock<'_>,
) -> Result<Self, OwnedBeaconChainBlockError>
pub fn from_block( block: BeaconChainBlock<'_>, ) -> Result<Self, OwnedBeaconChainBlockError>
Create owned block from a reference
Sourcepub fn from_buffers(
header: SharedAlignedBuffer,
body: SharedAlignedBuffer,
) -> Option<Self>
pub fn from_buffers( header: SharedAlignedBuffer, body: SharedAlignedBuffer, ) -> Option<Self>
Create owned block from buffers
Sourcepub fn block(&self) -> BeaconChainBlock<'_>
pub fn block(&self) -> BeaconChainBlock<'_>
Get BeaconChainBlock
out of OwnedBeaconChainBlock
Trait Implementations§
Source§impl Clone for OwnedBeaconChainBlock
impl Clone for OwnedBeaconChainBlock
Source§fn clone(&self) -> OwnedBeaconChainBlock
fn clone(&self) -> OwnedBeaconChainBlock
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 OwnedBeaconChainBlock
impl Debug for OwnedBeaconChainBlock
Source§impl From<OwnedBeaconChainBlock> for OwnedBlock
impl From<OwnedBeaconChainBlock> for OwnedBlock
Source§fn from(value: OwnedBeaconChainBlock) -> Self
fn from(value: OwnedBeaconChainBlock) -> Self
Converts to this type from the input type.
Source§impl GenericOwnedBlock for OwnedBeaconChainBlock
impl GenericOwnedBlock for OwnedBeaconChainBlock
Source§type Header = OwnedBeaconChainHeader
type Header = OwnedBeaconChainHeader
Block header type
Source§type Body = OwnedBeaconChainBody
type Body = OwnedBeaconChainBody
Block body type
Source§type Block<'a> = BeaconChainBlock<'a>
type Block<'a> = BeaconChainBlock<'a>
Block
Auto Trait Implementations§
impl Freeze for OwnedBeaconChainBlock
impl RefUnwindSafe for OwnedBeaconChainBlock
impl Send for OwnedBeaconChainBlock
impl Sync for OwnedBeaconChainBlock
impl Unpin for OwnedBeaconChainBlock
impl UnwindSafe for OwnedBeaconChainBlock
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