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,
},
PlanMismatch,
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 or Plan was given the same original shard index twice.
DuplicateRecoveryShardIndex
Decoder or Plan was given the same recovery shard index twice.
InvalidOriginalShardIndex
Decoder or Plan was given an invalid original shard index,
i.e. index >= original_count.
InvalidRecoveryShardIndex
Decoder or Plan was given an invalid recovery shard index,
i.e. index >= recovery_count.
InvalidShardSize
Configured shard size is zero, odd, or requires more working space than a single allocation can hold.
NotEnoughShards
Decoder or Plan 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
PlanMismatch
Decoder was given a Plan built for different shard counts or received
shard indices.
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()