Lines Matching refs:N

230 pub struct Bounded<T: Integer, const N: u32>(T);
238 impl<const N: u32> Bounded<$type, N> {
259 assert!(fits_within!(VALUE, $type, N));
276 impl<T, const N: u32> Bounded<T, N>
291 assert!(N != 0); in __new()
293 assert!(N <= T::BITS); in __new()
330 fits_within(value, N).then(|| { in try_new()
369 fits_within(expr, N), in from_expr()
408 M >= N, in extend()
459 pub fn cast<U>(self) -> Bounded<U, N> in cast()
475 impl<T, const N: u32> Deref for Bounded<T, N>
483 if !fits_within(self.0, N) { in deref()
508 pub trait TryIntoBounded<T: Integer, const N: u32> {
512 fn try_into_bounded(self) -> Option<Bounded<T, N>>; in try_into_bounded() argument
516 impl<T, U, const N: u32> TryIntoBounded<T, N> for U
521 fn try_into_bounded(self) -> Option<Bounded<T, N>> { in try_into_bounded() argument
528 impl<T, U, const N: u32, const M: u32> PartialEq<Bounded<U, M>> for Bounded<T, N>
539 impl<T, const N: u32> Eq for Bounded<T, N> where T: Integer {}
541 impl<T, U, const N: u32, const M: u32> PartialOrd<Bounded<U, M>> for Bounded<T, N>
552 impl<T, const N: u32> Ord for Bounded<T, N>
564 impl<T, const N: u32> PartialEq<T> for Bounded<T, N>
574 impl<T, const N: u32> PartialOrd<T> for Bounded<T, N>
586 impl<T, const N: u32, const M: u32> ops::Add<Bounded<T, M>> for Bounded<T, N>
598 impl<T, const N: u32, const M: u32> ops::BitAnd<Bounded<T, M>> for Bounded<T, N>
610 impl<T, const N: u32, const M: u32> ops::BitOr<Bounded<T, M>> for Bounded<T, N>
622 impl<T, const N: u32, const M: u32> ops::BitXor<Bounded<T, M>> for Bounded<T, N>
634 impl<T, const N: u32, const M: u32> ops::Div<Bounded<T, M>> for Bounded<T, N>
646 impl<T, const N: u32, const M: u32> ops::Mul<Bounded<T, M>> for Bounded<T, N>
658 impl<T, const N: u32, const M: u32> ops::Rem<Bounded<T, M>> for Bounded<T, N>
670 impl<T, const N: u32, const M: u32> ops::Sub<Bounded<T, M>> for Bounded<T, N>
684 impl<T, const N: u32> ops::Add<T> for Bounded<T, N>
696 impl<T, const N: u32> ops::BitAnd<T> for Bounded<T, N>
708 impl<T, const N: u32> ops::BitOr<T> for Bounded<T, N>
720 impl<T, const N: u32> ops::BitXor<T> for Bounded<T, N>
732 impl<T, const N: u32> ops::Div<T> for Bounded<T, N>
744 impl<T, const N: u32> ops::Mul<T> for Bounded<T, N>
756 impl<T, const N: u32> ops::Neg for Bounded<T, N>
768 impl<T, const N: u32> ops::Not for Bounded<T, N>
780 impl<T, const N: u32> ops::Rem<T> for Bounded<T, N>
792 impl<T, const N: u32> ops::Sub<T> for Bounded<T, N>
806 impl<T, const N: u32> fmt::Display for Bounded<T, N>
816 impl<T, const N: u32> fmt::Binary for Bounded<T, N>
826 impl<T, const N: u32> fmt::LowerExp for Bounded<T, N>
836 impl<T, const N: u32> fmt::LowerHex for Bounded<T, N>
846 impl<T, const N: u32> fmt::Octal for Bounded<T, N>
856 impl<T, const N: u32> fmt::UpperExp for Bounded<T, N>
866 impl<T, const N: u32> fmt::UpperHex for Bounded<T, N>
889 trait AtLeastXBits<const N: usize> {}
940 impl<T, const N: u32> From<$type> for Bounded<T, N>
963 trait FitsInXBits<const N: usize> {}
1016 impl<T, const N: u32> From<Bounded<T, N>> for $type
1020 Bounded<T, N>: FitsInXBits<{ <$type as Integer>::BITS as usize }>,
1022 fn from(value: Bounded<T, N>) -> $type {
1049 impl<T, const N: u32> From<bool> for Bounded<T, N>