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 given or inferred shard size.
- Shard size is given explicitly to encoders/decoders
and inferred for
reed_solomon_simd::encodeandreed_solomon_simd::decode.
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
Given or inferred shard size is invalid: Size must be non-zero and even.
- Shard size is given explicitly to encoders/decoders
and inferred for
reed_solomon_simd::encodeandreed_solomon_simd::decode.
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§
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
impl Copy for Error
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 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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)