Lines Matching full:integer

3 //! Implementation of [`Bounded`], a wrapper around integer types limiting the number of bits
16 num::Integer,
39 fn fits_within<T: Integer>(value: T, num_bits: u32) -> bool { in fits_within()
43 /// An integer value that requires only the `N` less significant bits of the wrapped type to be
46 /// This limits the number of usable bits in the wrapped integer type, and thus the stored value to
64 /// // An unsigned 8-bit integer, of which only the 4 LSBs are used.
160 /// Infallible conversions from a primitive integer to a large-enough [`Bounded`] are supported.
186 /// Infallible conversions from a [`Bounded`] to a primitive integer are also supported, and
214 /// Fallible conversions from any primitive integer to any [`Bounded`] are also supported using the
230 pub struct Bounded<T: Integer, const N: u32>(T);
278 T: Integer,
461 U: TryFrom<T> + Integer, in cast() argument
462 T: Integer, in cast() argument
463 U: Integer<Signedness = T::Signedness>, in cast()
477 T: Integer,
508 pub trait TryIntoBounded<T: Integer, const N: u32> {
515 /// Any integer value can be attempted to be converted into a [`Bounded`] of any size.
518 T: Integer,
530 T: Integer,
531 U: Integer,
539 impl<T, const N: u32> Eq for Bounded<T, N> where T: Integer {}
543 T: Integer,
544 U: Integer,
554 T: Integer,
566 T: Integer,
576 T: Integer,
588 T: Integer,
600 T: Integer,
612 T: Integer,
624 T: Integer,
636 T: Integer,
648 T: Integer,
660 T: Integer,
672 T: Integer,
686 T: Integer,
698 T: Integer,
710 T: Integer,
722 T: Integer,
734 T: Integer,
746 T: Integer,
758 T: Integer,
770 T: Integer,
782 T: Integer,
794 T: Integer,
808 T: Integer,
818 T: Integer,
828 T: Integer,
838 T: Integer,
848 T: Integer,
858 T: Integer,
868 T: Integer,
882 impl<T> $trait for Bounded<T, $num_bits> where T: Integer {}
942 $type: Integer,
943 T: Integer<Signedness = <$type as Integer>::Signedness> + From<$type>,
944 Self: AtLeastXBits<{ <$type as Integer>::BITS as usize }>,
1018 $type: Integer + TryFrom<T>,
1019 T: Integer<Signedness = <$type as Integer>::Signedness>,
1020 Bounded<T, N>: FitsInXBits<{ <$type as Integer>::BITS as usize }>,
1042 T: Integer + Zeroable,
1051 T: Integer + From<bool>,
1055 // integer type for any `N` > 0. in from()