Trait small_fixed_array::ValidLength
source · pub trait ValidLength: Sealed + Default + Copy + TryFrom<usize> + Into<u32> {
const ZERO: Self;
const MAX: usize;
// Required method
fn to_usize(self) -> usize;
// Provided method
fn from_usize<T>(
val: Box<[T]>
) -> Result<(Self, Box<[T]>), InvalidLength<T>> { ... }
}
Expand description
A sealed trait to represent valid lengths for a FixedArray
.
This is implemented on u32
for non-16 bit platforms, and u16
on all platforms.
Required Associated Constants§
Required Methods§
Provided Methods§
Object Safety§
This trait is not object safe.
Implementations on Foreign Types§
source§impl ValidLength for u8
impl ValidLength for u8
source§impl ValidLength for u16
impl ValidLength for u16
source§impl ValidLength for u32
Available on 64-bit or 32-bit only.
impl ValidLength for u32
Available on 64-bit or 32-bit only.