pub struct CodedBlock<B: Block, C: Scheme, H: Hasher> { /* private fields */ }Expand description
An envelope type for an erasure coded Block.
Implementations§
Source§impl<B: Block, C: Scheme, H: Hasher> CodedBlock<B, C, H>
impl<B: Block, C: Scheme, H: Hasher> CodedBlock<B, C, H>
Sourcepub fn new(inner: B, config: CodingConfig, strategy: &impl Strategy) -> Self
pub fn new(inner: B, config: CodingConfig, strategy: &impl Strategy) -> Self
Create a new CodedBlock from a Block and a configuration.
Sourcepub fn new_trusted(inner: B, commitment: Commitment) -> Self
pub fn new_trusted(inner: B, commitment: Commitment) -> Self
Create a new CodedBlock from a Block and trusted Commitment.
Sourcepub const fn config(&self) -> CodingConfig
pub const fn config(&self) -> CodingConfig
Returns the coding configuration for the data committed.
Sourcepub fn shards(&mut self, strategy: &impl Strategy) -> &[C::StrongShard]
pub fn shards(&mut self, strategy: &impl Strategy) -> &[C::StrongShard]
Returns a reference to the shards in this coded block.
If the shards have not yet been generated, they will be created via Scheme::encode.
Sourcepub fn shard(&self, index: u16) -> Option<Shard<C, H>>where
B: CertifiableBlock,
pub fn shard(&self, index: u16) -> Option<Shard<C, H>>where
B: CertifiableBlock,
Returns a Shard at the given index, if the index is valid.
Sourcepub fn into_inner(self) -> B
pub fn into_inner(self) -> B
Takes the inner Block.
Trait Implementations§
Source§impl<B: CertifiableBlock, C: Scheme, H: Hasher> Block for CodedBlock<B, C, H>
impl<B: CertifiableBlock, C: Scheme, H: Hasher> Block for CodedBlock<B, C, H>
Source§impl<B: CertifiableBlock, C: Scheme, H: Hasher> CertifiableBlock for CodedBlock<B, C, H>
impl<B: CertifiableBlock, C: Scheme, H: Hasher> CertifiableBlock for CodedBlock<B, C, H>
Source§impl<B: CertifiableBlock, C: Scheme, H: Hasher> Committable for CodedBlock<B, C, H>
impl<B: CertifiableBlock, C: Scheme, H: Hasher> Committable for CodedBlock<B, C, H>
Source§type Commitment = Commitment
type Commitment = Commitment
The type of commitment produced by this object.
Source§fn commitment(&self) -> Self::Commitment
fn commitment(&self) -> Self::Commitment
Source§impl<B: Block, C: Scheme, H: Hasher> Digestible for CodedBlock<B, C, H>
impl<B: Block, C: Scheme, H: Hasher> Digestible for CodedBlock<B, C, H>
Source§impl<B: Block, C: Scheme, H: Hasher> EncodeSize for CodedBlock<B, C, H>
impl<B: Block, C: Scheme, H: Hasher> EncodeSize for CodedBlock<B, C, H>
Source§fn encode_size(&self) -> usize
fn encode_size(&self) -> usize
Returns the encoded size of this value (in bytes).
Source§impl<B: CertifiableBlock, C: Scheme, H: Hasher> From<CodedBlock<B, C, H>> for StoredCodedBlock<B, C, H>
impl<B: CertifiableBlock, C: Scheme, H: Hasher> From<CodedBlock<B, C, H>> for StoredCodedBlock<B, C, H>
Source§fn from(block: CodedBlock<B, C, H>) -> Self
fn from(block: CodedBlock<B, C, H>) -> Self
Converts to this type from the input type.
Source§impl<B: Block, C: Scheme, H: Hasher> From<StoredCodedBlock<B, C, H>> for CodedBlock<B, C, H>
Converts a StoredCodedBlock back to a CodedBlock.
impl<B: Block, C: Scheme, H: Hasher> From<StoredCodedBlock<B, C, H>> for CodedBlock<B, C, H>
Converts a StoredCodedBlock back to a CodedBlock.
Source§fn from(stored: StoredCodedBlock<B, C, H>) -> Self
fn from(stored: StoredCodedBlock<B, C, H>) -> Self
Converts to this type from the input type.
Source§impl<B: Block, C: Scheme, H: Hasher> Heightable for CodedBlock<B, C, H>
impl<B: Block, C: Scheme, H: Hasher> Heightable for CodedBlock<B, C, H>
Source§impl<B: Block, C: Scheme, H: Hasher> Read for CodedBlock<B, C, H>
impl<B: Block, C: Scheme, H: Hasher> Read for CodedBlock<B, C, H>
impl<B: Block + Eq, C: Scheme, H: Hasher> Eq for CodedBlock<B, C, H>
Auto Trait Implementations§
impl<B, C, H> Freeze for CodedBlock<B, C, H>
impl<B, C, H> RefUnwindSafe for CodedBlock<B, C, H>where
B: RefUnwindSafe,
<C as Scheme>::Commitment: RefUnwindSafe,
H: RefUnwindSafe,
<C as Scheme>::StrongShard: RefUnwindSafe,
impl<B, C, H> Send for CodedBlock<B, C, H>
impl<B, C, H> Sync for CodedBlock<B, C, H>
impl<B, C, H> Unpin for CodedBlock<B, C, H>
impl<B, C, H> UnsafeUnpin for CodedBlock<B, C, H>
impl<B, C, H> UnwindSafe for CodedBlock<B, C, H>where
B: UnwindSafe,
<C as Scheme>::Commitment: UnwindSafe,
H: UnwindSafe,
<C as Scheme>::StrongShard: UnwindSafe,
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<X, U> DecodeRangeExt<X> for U
impl<X, U> DecodeRangeExt<X> for U
Source§fn decode_range(
buf: impl Buf,
range: impl RangeBounds<usize>,
) -> Result<Self, Error>
fn decode_range( buf: impl Buf, range: impl RangeBounds<usize>, ) -> Result<Self, Error>
Decodes a value using only a range configuration. Read more
Source§impl<T> Encode for Twhere
T: Write + EncodeSize,
impl<T> Encode for Twhere
T: Write + EncodeSize,
Source§impl<T> EncodeExt for Twhere
T: EncodeSize + Write,
impl<T> EncodeExt for Twhere
T: EncodeSize + Write,
Source§fn encode_with_pool_mut(&self, pool: &BufferPool) -> IoBufMut
fn encode_with_pool_mut(&self, pool: &BufferPool) -> IoBufMut
Source§fn encode_with_pool(&self, pool: &BufferPool) -> IoBuf
fn encode_with_pool(&self, pool: &BufferPool) -> IoBuf
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<B> IntoBlock<B> for B
impl<B> IntoBlock<B> for B
Source§fn into_block(self) -> B
fn into_block(self) -> B
Convert this cached block into the underlying block type.
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<X, U> ReadRangeExt<X> for U
impl<X, U> ReadRangeExt<X> for U
Source§fn read_range(
buf: &mut impl Buf,
range: impl RangeBounds<usize>,
) -> Result<Self, Error>
fn read_range( buf: &mut impl Buf, range: impl RangeBounds<usize>, ) -> Result<Self, Error>
Reads a value using only a range configuration. Read more