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::encode
andreed_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::encode
andreed_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.