[−][src]Struct solid::int::Uint
A simpler structure to represent all Solidity uint<N>
types using const generics
Due to const generics not being stable, the user would be required to specify both the size in bites and bytes (N and M respectively) for each type. N MUST be equal to M * 8.
let int256 = Uint<256, 32>(&[0u8; 32]); let int200 = Uint<200, 25>(&[0u8; 25]);
Note: It's very easy to missuse this structure because the even though the struct requries both the number of bits and bytes to be supplied, it cannot validate that N = M * 8 which is why it's not recommend to use this until const generics are stable.
Trait Implementations
impl<'a, const N: usize, const M: usize> Decode<'a> for Uint<'a, N, M> where
[u8; M]: LengthAtMost32,
[u8; M]: LengthAtLeast1,
[src]
[u8; M]: LengthAtMost32,
[u8; M]: LengthAtLeast1,
impl<'a, const N: usize, const M: usize> Encode for Uint<'a, N, M> where
[u8; M]: LengthAtMost32,
[u8; M]: LengthAtLeast1,
[src]
[u8; M]: LengthAtMost32,
[u8; M]: LengthAtLeast1,
impl<'a, const N: usize, const M: usize> IntoType for Uint<'a, N, M> where
[u8; M]: LengthAtMost32,
[u8; M]: LengthAtLeast1,
[src]
[u8; M]: LengthAtMost32,
[u8; M]: LengthAtLeast1,
Auto Trait Implementations
impl<'a, const N: usize, const M: usize> RefUnwindSafe for Uint<'a, N, M>
impl<'a, const N: usize, const M: usize> Send for Uint<'a, N, M>
impl<'a, const N: usize, const M: usize> Sync for Uint<'a, N, M>
impl<'a, const N: usize, const M: usize> Unpin for Uint<'a, N, M>
impl<'a, const N: usize, const M: usize> UnwindSafe for Uint<'a, N, M>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,