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 can’t be modified after creation, so that the header always corresponds to the body, which constructors ensure.
Fields§
§header: OwnedLeafShardHeaderBlock header
body: OwnedLeafShardBodyBlock body
Implementations§
Source§impl OwnedLeafShardBlock
impl OwnedLeafShardBlock
Sourcepub fn init<OS>(
own_segments: OS,
) -> Result<OwnedLeafShardBlockBuilder, OwnedLeafShardBodyError>
pub fn init<OS>( own_segments: OS, ) -> Result<OwnedLeafShardBlockBuilder, OwnedLeafShardBodyError>
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§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§const SHARD_KIND: RealShardKind = RealShardKind::LeafShard
const SHARD_KIND: RealShardKind = RealShardKind::LeafShard
Shard kind
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
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 OwnedLeafShardBlock
impl Freeze for OwnedLeafShardBlock
impl RefUnwindSafe for OwnedLeafShardBlock
impl Send for OwnedLeafShardBlock
impl Sync for OwnedLeafShardBlock
impl Unpin for OwnedLeafShardBlock
impl UnsafeUnpin 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