pub struct VerifyWorkspace<F: Field> { /* private fields */ }Expand description
Reusable parity scratch space for repeated verify calls.
This helper keeps the parity buffer allocation outside of verify so
repeated callers can naturally take the verify_with_buffer fast path
without having to manage Vec<Vec<_>> details themselves.
Implementations§
Source§impl<F: Field> VerifyWorkspace<F>
impl<F: Field> VerifyWorkspace<F>
Sourcepub fn new(codec: &ReedSolomon<F>, shard_len: usize) -> Self
pub fn new(codec: &ReedSolomon<F>, shard_len: usize) -> Self
Create a new workspace with parity buffers sized for the given codec and shard length.
Sourcepub fn parity_shards(&self) -> usize
pub fn parity_shards(&self) -> usize
Returns the number of parity shard buffers.
Sourcepub fn shard_len(&self) -> Option<usize>
pub fn shard_len(&self) -> Option<usize>
Returns the current shard buffer length, or None if there are no parity shards.
Sourcepub fn resize(&mut self, codec: &ReedSolomon<F>, shard_len: usize)
pub fn resize(&mut self, codec: &ReedSolomon<F>, shard_len: usize)
Resize parity buffers to match the given codec and shard length.
Trait Implementations§
Source§impl<F: Clone + Field> Clone for VerifyWorkspace<F>
impl<F: Clone + Field> Clone for VerifyWorkspace<F>
Source§fn clone(&self) -> VerifyWorkspace<F>
fn clone(&self) -> VerifyWorkspace<F>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<F: PartialEq + Field> StructuralPartialEq for VerifyWorkspace<F>
Auto Trait Implementations§
impl<F> Freeze for VerifyWorkspace<F>
impl<F> RefUnwindSafe for VerifyWorkspace<F>
impl<F> Send for VerifyWorkspace<F>
impl<F> Sync for VerifyWorkspace<F>
impl<F> Unpin for VerifyWorkspace<F>
impl<F> UnsafeUnpin for VerifyWorkspace<F>
impl<F> UnwindSafe for VerifyWorkspace<F>
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