pub struct BeaconChainBody<'a> {
pub own_segment_roots: &'a [SegmentRoot],
pub intermediate_shard_blocks: IntermediateShardBlocksInfo<'a>,
pub pot_checkpoints: &'a [PotCheckpoints],
}
Expand description
Block body that corresponds to the beacon chain
Fields§
§own_segment_roots: &'a [SegmentRoot]
Segment roots produced by this shard
intermediate_shard_blocks: IntermediateShardBlocksInfo<'a>
Intermediate shard blocks
pot_checkpoints: &'a [PotCheckpoints]
Proof of time checkpoints from after future proof of time of the parent block to current block’s future proof of time (inclusive)
Implementations§
Source§impl<'a> BeaconChainBody<'a>
impl<'a> BeaconChainBody<'a>
Sourcepub fn try_from_bytes(bytes: &'a [u8]) -> Option<(Self, &'a [u8])>
pub fn try_from_bytes(bytes: &'a [u8]) -> Option<(Self, &'a [u8])>
Create an instance from provided correctly aligned bytes.
bytes
should be 4-bytes aligned.
Returns an instance and remaining bytes on success.
Sourcepub fn is_internally_consistent(&self) -> bool
pub fn is_internally_consistent(&self) -> bool
Check block body’s internal consistency
Sourcepub fn try_from_bytes_unchecked(bytes: &'a [u8]) -> Option<(Self, &'a [u8])>
pub fn try_from_bytes_unchecked(bytes: &'a [u8]) -> Option<(Self, &'a [u8])>
The same as Self::try_from_bytes()
, but for trusted input that skips some consistency
checks
Sourcepub fn to_owned(self) -> Result<OwnedBeaconChainBody, OwnedBeaconChainBodyError>
pub fn to_owned(self) -> Result<OwnedBeaconChainBody, OwnedBeaconChainBodyError>
Create an owned version of this body
Sourcepub fn root(&self) -> Blake3Hash
pub fn root(&self) -> Blake3Hash
Compute block body root
Trait Implementations§
Source§impl<'a> Clone for BeaconChainBody<'a>
impl<'a> Clone for BeaconChainBody<'a>
Source§fn clone(&self) -> BeaconChainBody<'a>
fn clone(&self) -> BeaconChainBody<'a>
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<'a> Debug for BeaconChainBody<'a>
impl<'a> Debug for BeaconChainBody<'a>
Source§impl<'a> From<BeaconChainBody<'a>> for BlockBody<'a>
impl<'a> From<BeaconChainBody<'a>> for BlockBody<'a>
Source§fn from(value: BeaconChainBody<'a>) -> Self
fn from(value: BeaconChainBody<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a> GenericBlockBody<'a> for BeaconChainBody<'a>
impl<'a> GenericBlockBody<'a> for BeaconChainBody<'a>
Source§type Owned = OwnedBeaconChainBody
type Owned = OwnedBeaconChainBody
Owned block body
Source§fn try_to_owned(self) -> Option<Self::Owned>
fn try_to_owned(self) -> Option<Self::Owned>
Turn into owned version
Source§fn root(&self) -> Blake3Hash
fn root(&self) -> Blake3Hash
Compute block body root
impl<'a> Copy for BeaconChainBody<'a>
Auto Trait Implementations§
impl<'a> Freeze for BeaconChainBody<'a>
impl<'a> RefUnwindSafe for BeaconChainBody<'a>
impl<'a> Send for BeaconChainBody<'a>
impl<'a> Sync for BeaconChainBody<'a>
impl<'a> Unpin for BeaconChainBody<'a>
impl<'a> UnwindSafe for BeaconChainBody<'a>
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