pub trait BitSized<const LEN: usize>: ByteSized {
const BIT_SIZE: usize = _;
const MIN_BYTE_SIZE: usize = _;
// Provided methods
fn bit_size(&self) -> usize ⓘ { ... }
fn min_byte_size(&self) -> usize ⓘ { ... }
}
Expand description
Type size information in bits.
Indicates a size of exactly LEN
bits for the relevant data part of this type.
E.g. a bool
has a BitSized of 1 bit.
Provided Associated Constants§
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
impl BitSized<0> for ()
impl BitSized<1> for bool
impl BitSized<8> for i8
impl BitSized<8> for u8
impl BitSized<16> for i16
impl BitSized<16> for u16
impl BitSized<32> for char
impl BitSized<32> for f32
impl BitSized<32> for i32
impl BitSized<32> for u32
impl BitSized<64> for f64
impl BitSized<64> for i64
impl BitSized<64> for isize
impl BitSized<64> for u64
impl BitSized<64> for usize
impl BitSized<128> for i128
impl BitSized<128> for u128
impl BitSized<{$PTR_BITS * 2}> for &str
impl<T> BitSized<{$PTR_BITS * 2}> for &[T]
impl<T> BitSized<{$PTR_BITS * 2}> for &mut [T]
impl<T: BitSized<8>> BitSized<{$bits*$len}> for [T; 1]
impl<T: BitSized<8>> BitSized<{$bits*$len}> for [T; 2]
impl<T: BitSized<8>> BitSized<{$bits*$len}> for [T; 4]
impl<T: BitSized<8>> BitSized<{$bits*$len}> for [T; 8]
impl<T: BitSized<8>> BitSized<{$bits*$len}> for [T; 16]
impl<T: BitSized<16>> BitSized<{$bits*$len}> for [T; 1]
impl<T: BitSized<16>> BitSized<{$bits*$len}> for [T; 2]
impl<T: BitSized<16>> BitSized<{$bits*$len}> for [T; 4]
impl<T: BitSized<16>> BitSized<{$bits*$len}> for [T; 8]
impl<T: BitSized<16>> BitSized<{$bits*$len}> for [T; 16]
impl<T: BitSized<24>> BitSized<{$bits*$len}> for [T; 1]
impl<T: BitSized<24>> BitSized<{$bits*$len}> for [T; 2]
impl<T: BitSized<24>> BitSized<{$bits*$len}> for [T; 4]
impl<T: BitSized<24>> BitSized<{$bits*$len}> for [T; 8]
impl<T: BitSized<24>> BitSized<{$bits*$len}> for [T; 16]
impl<T: BitSized<32>> BitSized<{$bits*$len}> for [T; 1]
impl<T: BitSized<32>> BitSized<{$bits*$len}> for [T; 2]
impl<T: BitSized<32>> BitSized<{$bits*$len}> for [T; 4]
impl<T: BitSized<32>> BitSized<{$bits*$len}> for [T; 8]
impl<T: BitSized<32>> BitSized<{$bits*$len}> for [T; 16]
impl<T: BitSized<40>> BitSized<{$bits*$len}> for [T; 1]
impl<T: BitSized<40>> BitSized<{$bits*$len}> for [T; 2]
impl<T: BitSized<40>> BitSized<{$bits*$len}> for [T; 4]
impl<T: BitSized<40>> BitSized<{$bits*$len}> for [T; 8]
impl<T: BitSized<40>> BitSized<{$bits*$len}> for [T; 16]
impl<T: BitSized<48>> BitSized<{$bits*$len}> for [T; 1]
impl<T: BitSized<48>> BitSized<{$bits*$len}> for [T; 2]
impl<T: BitSized<48>> BitSized<{$bits*$len}> for [T; 4]
impl<T: BitSized<48>> BitSized<{$bits*$len}> for [T; 8]
impl<T: BitSized<48>> BitSized<{$bits*$len}> for [T; 16]
impl<T: BitSized<56>> BitSized<{$bits*$len}> for [T; 1]
impl<T: BitSized<56>> BitSized<{$bits*$len}> for [T; 2]
impl<T: BitSized<56>> BitSized<{$bits*$len}> for [T; 4]
impl<T: BitSized<56>> BitSized<{$bits*$len}> for [T; 8]
impl<T: BitSized<56>> BitSized<{$bits*$len}> for [T; 16]
impl<T: BitSized<64>> BitSized<{$bits*$len}> for [T; 1]
impl<T: BitSized<64>> BitSized<{$bits*$len}> for [T; 2]
impl<T: BitSized<64>> BitSized<{$bits*$len}> for [T; 4]
impl<T: BitSized<64>> BitSized<{$bits*$len}> for [T; 8]
impl<T: BitSized<64>> BitSized<{$bits*$len}> for [T; 16]
impl<T: BitSized<72>> BitSized<{$bits*$len}> for [T; 1]
impl<T: BitSized<72>> BitSized<{$bits*$len}> for [T; 2]
impl<T: BitSized<72>> BitSized<{$bits*$len}> for [T; 4]
impl<T: BitSized<72>> BitSized<{$bits*$len}> for [T; 8]
impl<T: BitSized<72>> BitSized<{$bits*$len}> for [T; 16]
impl<T: BitSized<80>> BitSized<{$bits*$len}> for [T; 1]
impl<T: BitSized<80>> BitSized<{$bits*$len}> for [T; 2]
impl<T: BitSized<80>> BitSized<{$bits*$len}> for [T; 4]
impl<T: BitSized<80>> BitSized<{$bits*$len}> for [T; 8]
impl<T: BitSized<80>> BitSized<{$bits*$len}> for [T; 16]
impl<T: BitSized<88>> BitSized<{$bits*$len}> for [T; 1]
impl<T: BitSized<88>> BitSized<{$bits*$len}> for [T; 2]
impl<T: BitSized<88>> BitSized<{$bits*$len}> for [T; 4]
impl<T: BitSized<88>> BitSized<{$bits*$len}> for [T; 8]
impl<T: BitSized<88>> BitSized<{$bits*$len}> for [T; 16]
impl<T: BitSized<96>> BitSized<{$bits*$len}> for [T; 1]
impl<T: BitSized<96>> BitSized<{$bits*$len}> for [T; 2]
impl<T: BitSized<96>> BitSized<{$bits*$len}> for [T; 4]
impl<T: BitSized<96>> BitSized<{$bits*$len}> for [T; 8]
impl<T: BitSized<96>> BitSized<{$bits*$len}> for [T; 16]
impl<T: BitSized<104>> BitSized<{$bits*$len}> for [T; 1]
impl<T: BitSized<104>> BitSized<{$bits*$len}> for [T; 2]
impl<T: BitSized<104>> BitSized<{$bits*$len}> for [T; 4]
impl<T: BitSized<104>> BitSized<{$bits*$len}> for [T; 8]
impl<T: BitSized<104>> BitSized<{$bits*$len}> for [T; 16]
impl<T: BitSized<112>> BitSized<{$bits*$len}> for [T; 1]
impl<T: BitSized<112>> BitSized<{$bits*$len}> for [T; 2]
impl<T: BitSized<112>> BitSized<{$bits*$len}> for [T; 4]
impl<T: BitSized<112>> BitSized<{$bits*$len}> for [T; 8]
impl<T: BitSized<112>> BitSized<{$bits*$len}> for [T; 16]
impl<T: BitSized<120>> BitSized<{$bits*$len}> for [T; 1]
impl<T: BitSized<120>> BitSized<{$bits*$len}> for [T; 2]
impl<T: BitSized<120>> BitSized<{$bits*$len}> for [T; 4]
impl<T: BitSized<120>> BitSized<{$bits*$len}> for [T; 8]
impl<T: BitSized<120>> BitSized<{$bits*$len}> for [T; 16]
impl<T: BitSized<128>> BitSized<{$bits*$len}> for [T; 1]
impl<T: BitSized<128>> BitSized<{$bits*$len}> for [T; 2]
impl<T: BitSized<128>> BitSized<{$bits*$len}> for [T; 4]
impl<T: BitSized<128>> BitSized<{$bits*$len}> for [T; 8]
impl<T: BitSized<128>> BitSized<{$bits*$len}> for [T; 16]
Implementors§
impl BitSized<0> for Infallible
impl BitSized<0> for PhantomPinned
impl BitSized<1> for AtomicBool
impl BitSized<7> for AsciiChar
impl BitSized<7> for char7
impl BitSized<8> for Ordering
impl BitSized<8> for AtomicOrdering
impl BitSized<8> for char8
impl BitSized<8> for AtomicI8
impl BitSized<8> for AtomicU8
impl BitSized<8> for NonZeroI8
impl BitSized<8> for NonZeroU8
impl BitSized<16> for char16
impl BitSized<16> for AtomicI16
impl BitSized<16> for AtomicU16
impl BitSized<16> for NonZeroI16
impl BitSized<16> for NonZeroU16
impl BitSized<32> for AtomicF32
impl BitSized<32> for AtomicI32
impl BitSized<32> for AtomicU32
impl BitSized<32> for NonZeroI32
impl BitSized<32> for NonZeroU32
impl BitSized<64> for AtomicF64
impl BitSized<64> for AtomicI64
impl BitSized<64> for AtomicIsize
impl BitSized<64> for AtomicU64
impl BitSized<64> for AtomicUsize
impl BitSized<64> for NonZeroI64
impl BitSized<64> for NonZeroIsize
impl BitSized<64> for NonZeroU64
impl BitSized<64> for NonZeroUsize
impl BitSized<128> for Duration
impl BitSized<128> for SystemInstant
impl BitSized<128> for SystemTime
impl BitSized<128> for AtomicI128
impl BitSized<128> for AtomicU128
impl BitSized<128> for NonZeroI128
impl BitSized<128> for NonZeroU128
impl BitSized<{$PTR_BITS * 3}> for GraphemeString
impl BitSized<{$PTR_BITS * 3}> for String
impl<K, V> BitSized<{$PTR_BITS * 3}> for BTreeMap<K, V>
impl<K, V> BitSized<{$PTR_BITS * 3}> for HashMap<K, V>
impl<T> BitSized<0> for PhantomData<T>
impl<T> BitSized<64> for AtomicPtr<T>
impl<T> BitSized<{$PTR_BITS * 1}> for Arc<T>
impl<T> BitSized<{$PTR_BITS * 1}> for Rc<T>
impl<T> BitSized<{$PTR_BITS * 3}> for Mutex<T>
impl<T> BitSized<{$PTR_BITS * 3}> for BTreeSet<T>
impl<T> BitSized<{$PTR_BITS * 3}> for BinaryHeap<T>
impl<T> BitSized<{$PTR_BITS * 3}> for HashSet<T>
impl<T> BitSized<{$PTR_BITS * 3}> for LinkedList<T>
impl<T> BitSized<{$PTR_BITS * 3}> for Vec<T>
impl<T> BitSized<{$PTR_BITS * 3}> for VecDeque<T>
impl<T, const LEN: usize> BitSized<LEN> for TypeResource<T>
impl<T: BitSized<LEN>, const LEN: usize> BitSized<LEN> for BareBox<T>
impl<const LEN: usize> BitSized<LEN> for GraphemeNonul<LEN>
impl<const LEN: usize> BitSized<LEN> for StringNonul<LEN>
impl<const V: i8> BitSized<{$IP::BYTE_SIZE * 8}> for devela::_info::examples::niche::NonValueI8<V>
Available on
doc
only.