#[repr(C)]pub struct UInt<const N: usize>(pub [u8; N]);Expand description
A generic unsigned integer type with configurable byte size.
This type provides a zero-cost abstraction for fixed-size unsigned integers of arbitrary byte lengths. Common instantiations include UInt128, UInt160, UInt192, and UInt256.
§Type Parameters
N- The size of the integer in bytes
§Derived Traits
PartialEq, Eq: Essential for comparisons and use in collectionsDebug, Clone: Standard traits for development and consistency
Note: Copy is intentionally not derived because N can be arbitrarily large.
Tuple Fields§
§0: [u8; N]Implementations§
Trait Implementations§
impl<const N: usize> Eq for UInt<N>
Source§impl<const N: usize> FieldDecoder for UInt<N>
FieldDecoder for any fixed-width unsigned integer (Hash128/Hash160/Hash192/Hash256,
and any other UInt<N> instantiation): decodes an N-byte buffer into UInt<N>, failing if
the host wrote a different number of bytes.
impl<const N: usize> FieldDecoder for UInt<N>
FieldDecoder for any fixed-width unsigned integer (Hash128/Hash160/Hash192/Hash256,
and any other UInt<N> instantiation): decodes an N-byte buffer into UInt<N>, failing if
the host wrote a different number of bytes.
impl<const N: usize> StructuralPartialEq for UInt<N>
Auto Trait Implementations§
impl<const N: usize> Freeze for UInt<N>
impl<const N: usize> RefUnwindSafe for UInt<N>
impl<const N: usize> Send for UInt<N>
impl<const N: usize> Sync for UInt<N>
impl<const N: usize> Unpin for UInt<N>
impl<const N: usize> UnsafeUnpin for UInt<N>
impl<const N: usize> UnwindSafe for UInt<N>
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
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
Mutably borrows from an owned value. Read more