#[non_exhaustive]pub enum LeopardMode {
Disabled,
AsNeeded,
PreferGF16,
PreferLeopard,
}Expand description
Controls optional automatic selection of a Leopard codec when the requested
CodecFamily is Classic.
Auto-selection only takes effect on a byte-oriented field (where
size_of::<Field::Elem>() == 1, i.e. the GF(2^8) field the Leopard codecs
are built on); on any other field the mode is ignored and the codec stays
Classic. When the caller sets an explicit non-Classic codec_family, this
mode is likewise ignored — the explicit family wins.
The resolution, as a function of total = data + parity shards, mirrors the
klauspost/reedsolomon New() behaviour:
total | AsNeeded | PreferLeopard | PreferGF16 |
|---|---|---|---|
| ≤ 256 | Classic | LeopardGF8¹ | LeopardGF16 |
| 257..=65536 | LeopardGF16 | LeopardGF16 | LeopardGF16 |
¹ PreferLeopard selects LeopardGF8
only when total ≤ 256 and parity ≤ 128; otherwise it falls back to
LeopardGF16.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Disabled
Never auto-select Leopard. The codec behaves exactly as an explicit
CodecFamily::Classic construction — byte-for-byte identical to
releases before auto-activation existed. This is the default.
AsNeeded
Use Classic while it can represent the configuration (total ≤ 256), and
automatically switch to LeopardGF16 once the
shard count exceeds what GF(2^8) can address.
PreferGF16
Always use LeopardGF16 (for any supported
shard count up to 65536).
PreferLeopard
Prefer a Leopard codec whenever possible: LeopardGF8
for small byte-friendly configurations (total ≤ 256 and parity ≤ 128),
otherwise LeopardGF16.
Trait Implementations§
Source§impl Clone for LeopardMode
impl Clone for LeopardMode
Source§fn clone(&self) -> LeopardMode
fn clone(&self) -> LeopardMode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for LeopardMode
Source§impl Debug for LeopardMode
impl Debug for LeopardMode
Source§impl Default for LeopardMode
impl Default for LeopardMode
Source§fn default() -> LeopardMode
fn default() -> LeopardMode
impl Eq for LeopardMode
Source§impl PartialEq for LeopardMode
impl PartialEq for LeopardMode
impl StructuralPartialEq for LeopardMode
Auto Trait Implementations§
impl Freeze for LeopardMode
impl RefUnwindSafe for LeopardMode
impl Send for LeopardMode
impl Sync for LeopardMode
impl Unpin for LeopardMode
impl UnsafeUnpin for LeopardMode
impl UnwindSafe for LeopardMode
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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