#[non_exhaustive]pub struct OwnedLeafShardBlock {
pub header: OwnedLeafShardHeader,
pub body: OwnedLeafShardBody,
}
Expand description
An owned version of LeafShardBlock
.
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 (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.header: OwnedLeafShardHeader
Block header
body: OwnedLeafShardBody
Block body
Implementations§
Source§impl OwnedLeafShardBlock
impl OwnedLeafShardBlock
Sourcepub fn init<OSR>(
own_segment_roots: OSR,
) -> Result<OwnedLeafShardBlockBuilder, OwnedLeafShardBodyError>where
OSR: TrustedLen<Item = SegmentRoot>,
pub fn init<OSR>(
own_segment_roots: OSR,
) -> Result<OwnedLeafShardBlockBuilder, OwnedLeafShardBodyError>where
OSR: TrustedLen<Item = SegmentRoot>,
Initialize building of OwnedLeafShardBlock
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) -> LeafShardBlock<'_>
pub fn block(&self) -> LeafShardBlock<'_>
Get LeafShardBlock
out of OwnedLeafShardBlock
Trait Implementations§
Source§impl Clone for OwnedLeafShardBlock
impl Clone for OwnedLeafShardBlock
Source§fn clone(&self) -> OwnedLeafShardBlock
fn clone(&self) -> OwnedLeafShardBlock
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 Debug for OwnedLeafShardBlock
impl Debug for OwnedLeafShardBlock
Source§impl From<OwnedLeafShardBlock> for OwnedBlock
impl From<OwnedLeafShardBlock> for OwnedBlock
Source§fn from(value: OwnedLeafShardBlock) -> Self
fn from(value: OwnedLeafShardBlock) -> Self
Converts to this type from the input type.
Source§impl GenericOwnedBlock for OwnedLeafShardBlock
impl GenericOwnedBlock for OwnedLeafShardBlock
Source§type Header = OwnedLeafShardHeader
type Header = OwnedLeafShardHeader
Block header type
Source§type Body = OwnedLeafShardBody
type Body = OwnedLeafShardBody
Block body type
Source§type Block<'a> = LeafShardBlock<'a>
type Block<'a> = LeafShardBlock<'a>
Block
Auto Trait Implementations§
impl Freeze for OwnedLeafShardBlock
impl !RefUnwindSafe for OwnedLeafShardBlock
impl Send for OwnedLeafShardBlock
impl Sync for OwnedLeafShardBlock
impl Unpin for OwnedLeafShardBlock
impl !UnwindSafe for OwnedLeafShardBlock
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