pub trait ReconstructShard<F: Field> {
// Required methods
fn len(&self) -> Option<usize>;
fn get(&mut self) -> Option<&mut [F::Elem]>;
fn get_or_initialize(&mut self, len: usize) -> ReconstructInitResult<'_, F>;
// Provided method
fn is_empty(&self) -> bool { ... }
}Expand description
Something which might hold a shard.
This trait is used in reconstruction, where some of the shards may be unknown.
Required Methods§
Sourcefn get(&mut self) -> Option<&mut [F::Elem]>
fn get(&mut self) -> Option<&mut [F::Elem]>
Get a mutable reference to the shard data, returning None if uninitialized.
Sourcefn get_or_initialize(&mut self, len: usize) -> ReconstructInitResult<'_, F>
fn get_or_initialize(&mut self, len: usize) -> ReconstructInitResult<'_, F>
Get a mutable reference to the shard data, initializing it to the
given length if it was None. Returns an error if initialization fails.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".