pub struct LeafShardBody<'a> {
pub own_segment_roots: &'a [SegmentRoot],
pub transactions: Transactions<'a>,
}
Expand description
Block body that corresponds to a leaf shard
Fields§
§own_segment_roots: &'a [SegmentRoot]
Segment roots produced by this shard
transactions: Transactions<'a>
User transactions
Implementations§
Source§impl<'a> LeafShardBody<'a>
impl<'a> LeafShardBody<'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
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 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) -> Result<OwnedLeafShardBody, OwnedLeafShardBodyError>
pub fn to_owned(self) -> Result<OwnedLeafShardBody, OwnedLeafShardBodyError>
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 LeafShardBody<'a>
impl<'a> Clone for LeafShardBody<'a>
Source§fn clone(&self) -> LeafShardBody<'a>
fn clone(&self) -> LeafShardBody<'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 LeafShardBody<'a>
impl<'a> Debug for LeafShardBody<'a>
Source§impl<'a> From<LeafShardBody<'a>> for BlockBody<'a>
impl<'a> From<LeafShardBody<'a>> for BlockBody<'a>
Source§fn from(value: LeafShardBody<'a>) -> Self
fn from(value: LeafShardBody<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a> GenericBlockBody<'a> for LeafShardBody<'a>
impl<'a> GenericBlockBody<'a> for LeafShardBody<'a>
Source§type Owned = OwnedLeafShardBody
type Owned = OwnedLeafShardBody
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 LeafShardBody<'a>
Auto Trait Implementations§
impl<'a> Freeze for LeafShardBody<'a>
impl<'a> RefUnwindSafe for LeafShardBody<'a>
impl<'a> Send for LeafShardBody<'a>
impl<'a> Sync for LeafShardBody<'a>
impl<'a> Unpin for LeafShardBody<'a>
impl<'a> UnwindSafe for LeafShardBody<'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