pub struct OwnedIntermediateShardBlock {
pub header: OwnedIntermediateShardHeader,
pub body: OwnedIntermediateShardBody,
}Expand description
An owned version of IntermediateShardBlock.
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 can’t be modified after creation, so that the header always corresponds to the body, which constructors ensure.
Fields§
§header: OwnedIntermediateShardHeaderBlock header
body: OwnedIntermediateShardBodyBlock body
Implementations§
Source§impl OwnedIntermediateShardBlock
impl OwnedIntermediateShardBlock
Sourcepub fn init<'a, OS, LSB>(
own_segments: OS,
leaf_shard_blocks: LSB,
) -> Result<OwnedIntermediateShardBlockBuilder, OwnedIntermediateShardBodyError>where
OS: TrustedLen<Item = (LocalSegmentIndex, SegmentRoot)>,
LSB: TrustedLen<Item = LeafShardBlockInfo<'a>> + Clone + 'a,
pub fn init<'a, OS, LSB>(
own_segments: OS,
leaf_shard_blocks: LSB,
) -> Result<OwnedIntermediateShardBlockBuilder, OwnedIntermediateShardBodyError>where
OS: TrustedLen<Item = (LocalSegmentIndex, SegmentRoot)>,
LSB: TrustedLen<Item = LeafShardBlockInfo<'a>> + Clone + 'a,
Initialize building of OwnedIntermediateShardBlock
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) -> IntermediateShardBlock<'_>
pub fn block(&self) -> IntermediateShardBlock<'_>
Trait Implementations§
Source§impl Clone for OwnedIntermediateShardBlock
impl Clone for OwnedIntermediateShardBlock
Source§impl Debug for OwnedIntermediateShardBlock
impl Debug for OwnedIntermediateShardBlock
Source§impl From<OwnedIntermediateShardBlock> for OwnedBlock
impl From<OwnedIntermediateShardBlock> for OwnedBlock
Source§fn from(value: OwnedIntermediateShardBlock) -> Self
fn from(value: OwnedIntermediateShardBlock) -> Self
Converts to this type from the input type.
Source§impl GenericOwnedBlock for OwnedIntermediateShardBlock
impl GenericOwnedBlock for OwnedIntermediateShardBlock
Source§const SHARD_KIND: RealShardKind = RealShardKind::IntermediateShard
const SHARD_KIND: RealShardKind = RealShardKind::IntermediateShard
Shard kind
Source§type Header = OwnedIntermediateShardHeader
type Header = OwnedIntermediateShardHeader
Block header type
Source§type Body = OwnedIntermediateShardBody
type Body = OwnedIntermediateShardBody
Block body type
Source§type Block<'a> = IntermediateShardBlock<'a>
type Block<'a> = IntermediateShardBlock<'a>
Block
Source§fn from_buffers(
header: SharedAlignedBuffer,
body: SharedAlignedBuffer,
) -> Option<Self>
fn from_buffers( header: SharedAlignedBuffer, body: SharedAlignedBuffer, ) -> Option<Self>
Create owned block from buffers
Auto Trait Implementations§
impl Forget for OwnedIntermediateShardBlock
impl Freeze for OwnedIntermediateShardBlock
impl RefUnwindSafe for OwnedIntermediateShardBlock
impl Send for OwnedIntermediateShardBlock
impl Sync for OwnedIntermediateShardBlock
impl Unpin for OwnedIntermediateShardBlock
impl UnsafeUnpin for OwnedIntermediateShardBlock
impl UnwindSafe for OwnedIntermediateShardBlock
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