pub struct ErasureCodeBuilder { /* private fields */ }Expand description
The ErasureCodeBuilder is used to build the ErasureCode struct.
It is a builder pattern that allows you to set the parameters of the erasure code.
Implementations§
Source§impl ErasureCodeBuilder
impl ErasureCodeBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new ErasureCodeBuilder instance.
With default values:
kandmare not setwisCodeWord::W8packet_sizeis not settechis not setcoding_methodis not set
Sourcepub fn k(self, k: NonZeroI32) -> Self
pub fn k(self, k: NonZeroI32) -> Self
Set the number of data devices.
Sourcepub fn m(self, m: NonZeroI32) -> Self
pub fn m(self, m: NonZeroI32) -> Self
Set the number of parity devices.
Sourcepub fn packet_size(self, packet_size: NonZeroI32) -> Self
pub fn packet_size(self, packet_size: NonZeroI32) -> Self
Sourcepub fn coding_method(self, method: CodingMethod) -> Self
pub fn coding_method(self, method: CodingMethod) -> Self
Set the coding method.
Sourcepub fn build(self) -> Result<ErasureCode, Error>
pub fn build(self) -> Result<ErasureCode, Error>
Build the ErasureCode struct.
Trait Implementations§
Source§impl Clone for ErasureCodeBuilder
impl Clone for ErasureCodeBuilder
Source§fn clone(&self) -> ErasureCodeBuilder
fn clone(&self) -> ErasureCodeBuilder
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 moreSource§impl Debug for ErasureCodeBuilder
impl Debug for ErasureCodeBuilder
Source§impl Default for ErasureCodeBuilder
impl Default for ErasureCodeBuilder
Source§fn default() -> ErasureCodeBuilder
fn default() -> ErasureCodeBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ErasureCodeBuilder
impl RefUnwindSafe for ErasureCodeBuilder
impl Send for ErasureCodeBuilder
impl Sync for ErasureCodeBuilder
impl Unpin for ErasureCodeBuilder
impl UnsafeUnpin for ErasureCodeBuilder
impl UnwindSafe for ErasureCodeBuilder
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