#[non_exhaustive]pub struct IntermediateShardBody<'a> { /* private fields */ }
Expand description
Block body that corresponds to an intermediate shard
Implementations§
Source§impl<'a> IntermediateShardBody<'a>
impl<'a> IntermediateShardBody<'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 bytes.
bytes
do not need to be 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.
This is usually not necessary to be called explicitly since internal consistency is checked
by Self::try_from_bytes()
internally.
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 own_segment_roots(&self) -> &'a [SegmentRoot]
pub fn own_segment_roots(&self) -> &'a [SegmentRoot]
Segment roots produced by this shard
Sourcepub fn leaf_shard_blocks(&self) -> &LeafShardBlocksInfo<'a>
pub fn leaf_shard_blocks(&self) -> &LeafShardBlocksInfo<'a>
Leaf shard blocks
Sourcepub fn segment_roots_proof(&self) -> [u8; 32]
pub fn segment_roots_proof(&self) -> [u8; 32]
Proof for segment roots included in the body
Sourcepub fn to_owned(self) -> OwnedIntermediateShardBody
pub fn to_owned(self) -> OwnedIntermediateShardBody
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 IntermediateShardBody<'a>
impl<'a> Clone for IntermediateShardBody<'a>
Source§fn clone(&self) -> IntermediateShardBody<'a>
fn clone(&self) -> IntermediateShardBody<'a>
Returns a duplicate 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 IntermediateShardBody<'a>
impl<'a> Debug for IntermediateShardBody<'a>
Source§impl<'a> From<IntermediateShardBody<'a>> for BlockBody<'a>
impl<'a> From<IntermediateShardBody<'a>> for BlockBody<'a>
Source§fn from(value: IntermediateShardBody<'a>) -> Self
fn from(value: IntermediateShardBody<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a> GenericBlockBody<'a> for IntermediateShardBody<'a>
impl<'a> GenericBlockBody<'a> for IntermediateShardBody<'a>
Source§impl<'a> Yokeable<'a> for IntermediateShardBody<'static>
impl<'a> Yokeable<'a> for IntermediateShardBody<'static>
Source§type Output = IntermediateShardBody<'a>
type Output = IntermediateShardBody<'a>
This type MUST be
Self
with the 'static
replaced with 'a
, i.e. Self<'a>
Source§fn transform_owned(self) -> Self::Output
fn transform_owned(self) -> Self::Output
Source§unsafe fn make(this: Self::Output) -> Self
unsafe fn make(this: Self::Output) -> Self
This method can be used to cast away
Self<'a>
’s lifetime. Read moreSource§fn transform_mut<F>(&'a mut self, f: F)where
F: 'static + for<'b> FnOnce(&'b mut Self::Output),
fn transform_mut<F>(&'a mut self, f: F)where
F: 'static + for<'b> FnOnce(&'b mut Self::Output),
This method must cast
self
between &'a mut Self<'static>
and &'a mut Self<'a>
,
and pass it to f
. Read moreimpl<'a> Copy for IntermediateShardBody<'a>
Auto Trait Implementations§
impl<'a> Freeze for IntermediateShardBody<'a>
impl<'a> RefUnwindSafe for IntermediateShardBody<'a>
impl<'a> Send for IntermediateShardBody<'a>
impl<'a> Sync for IntermediateShardBody<'a>
impl<'a> Unpin for IntermediateShardBody<'a>
impl<'a> UnwindSafe for IntermediateShardBody<'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