pub enum Error {
DifferentShardSize {
shard_bytes: usize,
got: usize,
},
DuplicateOriginalShardIndex {
index: usize,
},
DuplicateRecoveryShardIndex {
index: usize,
},
InvalidOriginalShardIndex {
original_count: usize,
index: usize,
},
InvalidRecoveryShardIndex {
recovery_count: usize,
index: usize,
},
InvalidShardSize {
shard_bytes: usize,
},
NotEnoughShards {
original_count: usize,
original_received_count: usize,
recovery_received_count: usize,
},
TooFewOriginalShards {
original_count: usize,
original_received_count: usize,
},
TooManyOriginalShards {
original_count: usize,
},
UnsupportedShardCount {
original_count: usize,
recovery_count: usize,
},
}Expand description
Represents all possible errors that can occur in this library.
Variants§
DifferentShardSize
Given shard has different size than the configured shard size.
DuplicateOriginalShardIndex
Decoder was given two original shards with same index.
DuplicateRecoveryShardIndex
Decoder was given two recovery shards with same index.
InvalidOriginalShardIndex
Decoder was given original shard with invalid index,
i.e. index >= original_count.
InvalidRecoveryShardIndex
Decoder was given recovery shard with invalid index,
i.e. index >= recovery_count.
InvalidShardSize
Configured shard size is invalid: size must be non-zero and even.
NotEnoughShards
Decoder was given too few shards.
Decoding requires as many shards as there were original shards in total, in any combination of original shards and recovery shards.
Fields
TooFewOriginalShards
Encoder was given less than original_count original shards.
Fields
TooManyOriginalShards
Encoder was given more than original_count original shards.
UnsupportedShardCount
Given original_count / recovery_count combination is not supported.
Trait Implementations§
impl Copy for Error
Source§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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<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>
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>
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