Struct ethers_rs::Uint

source ·
pub struct Uint<const BITS: usize>(pub [u8; 32]);
Expand description

uint<M> type mapping

Tuple Fields§

§0: [u8; 32]

Implementations§

source§

impl<const BITS: usize> Uint<BITS>

source

pub fn new<N>(value: N) -> Result<Uint<BITS>, UintError>where N: ToBigUint + Unsigned,

Create Unit<BITS> from ToBigUint. Returns OutOfRange or ToBigUnit if failed.

Trait Implementations§

source§

impl<const BITS: usize, N> Add<N> for Uint<BITS>where N: ToBigUint,

§

type Output = Uint<BITS>

The resulting type after applying the + operator.
source§

fn add(self, rhs: N) -> <Uint<BITS> as Add<N>>::Output

Performs the + operation. Read more
source§

impl<const BITS: usize> Add<Uint<BITS>> for Uint<BITS>

§

type Output = Uint<BITS>

The resulting type after applying the + operator.
source§

fn add(self, rhs: Uint<BITS>) -> <Uint<BITS> as Add<Uint<BITS>>>::Output

Performs the + operation. Read more
source§

impl<const BITS: usize> Clone for Uint<BITS>

source§

fn clone(&self) -> Uint<BITS>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<const BITS: usize> Debug for Uint<BITS>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<const BITS: usize> Default for Uint<BITS>

source§

fn default() -> Uint<BITS>

Returns the “default value” for a type. Read more
source§

impl<'de, const BITS: usize> Deserialize<'de> for Uint<BITS>

source§

fn deserialize<D>( deserializer: D ) -> Result<Uint<BITS>, <D as Deserializer<'de>>::Error>where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<const BITS: usize> Display for Uint<BITS>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl From<Ether> for Uint<256>

source§

fn from(v: Ether) -> Uint<256>

Converts to this type from the input type.
source§

impl From<Finney> for Uint<256>

source§

fn from(v: Finney) -> Uint<256>

Converts to this type from the input type.
source§

impl From<Gwei> for Uint<256>

source§

fn from(v: Gwei) -> Uint<256>

Converts to this type from the input type.
source§

impl From<Kwei> for Uint<256>

source§

fn from(v: Kwei) -> Uint<256>

Converts to this type from the input type.
source§

impl From<Mwei> for Uint<256>

source§

fn from(v: Mwei) -> Uint<256>

Converts to this type from the input type.
source§

impl From<Szabo> for Uint<256>

source§

fn from(v: Szabo) -> Uint<256>

Converts to this type from the input type.
source§

impl From<Uint<256>> for BlockNumberOrTag

source§

fn from(v: Uint<256>) -> BlockNumberOrTag

Converts to this type from the input type.
source§

impl From<Wei> for Uint<256>

source§

fn from(v: Wei) -> Uint<256>

Converts to this type from the input type.
source§

impl<const BITS: usize> From<u128> for Uint<BITS>

source§

fn from(value: u128) -> Uint<BITS>

Converts to this type from the input type.
source§

impl<const BITS: usize> From<u16> for Uint<BITS>

source§

fn from(value: u16) -> Uint<BITS>

Converts to this type from the input type.
source§

impl<const BITS: usize> From<u32> for Uint<BITS>

source§

fn from(value: u32) -> Uint<BITS>

Converts to this type from the input type.
source§

impl<const BITS: usize> From<u64> for Uint<BITS>

source§

fn from(value: u64) -> Uint<BITS>

Converts to this type from the input type.
source§

impl<const BITS: usize> From<u8> for Uint<BITS>

source§

fn from(value: u8) -> Uint<BITS>

Converts to this type from the input type.
source§

impl<const BITS: usize> From<usize> for Uint<BITS>

source§

fn from(value: usize) -> Uint<BITS>

Converts to this type from the input type.
source§

impl<const BITS: usize> Hash for Uint<BITS>

source§

fn hash<__H>(&self, state: &mut __H)where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<const BITS: usize, N> Mul<N> for Uint<BITS>where N: ToBigUint,

§

type Output = Uint<BITS>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: N) -> <Uint<BITS> as Mul<N>>::Output

Performs the * operation. Read more
source§

impl<const BITS: usize> Mul<Uint<BITS>> for Uint<BITS>

§

type Output = Uint<BITS>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Uint<BITS>) -> <Uint<BITS> as Mul<Uint<BITS>>>::Output

Performs the * operation. Read more
source§

impl<const BITS: usize> PartialEq<Uint<BITS>> for Uint<BITS>

source§

fn eq(&self, other: &Uint<BITS>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<const BITS: usize> PartialOrd<Uint<BITS>> for Uint<BITS>

source§

fn partial_cmp(&self, other: &Uint<BITS>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<const BITS: usize> Serialize for Uint<BITS>

source§

fn serialize<S>( &self, serializer: S ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<const BITS: usize, N> Sub<N> for Uint<BITS>where N: ToBigUint,

§

type Output = Uint<BITS>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: N) -> <Uint<BITS> as Sub<N>>::Output

Performs the - operation. Read more
source§

impl<const BITS: usize> Sub<Uint<BITS>> for Uint<BITS>

§

type Output = Uint<BITS>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Uint<BITS>) -> <Uint<BITS> as Sub<Uint<BITS>>>::Output

Performs the - operation. Read more
source§

impl<const BITS: usize> TryFrom<&str> for Uint<BITS>

§

type Error = UintError

The type returned in the event of a conversion error.
source§

fn try_from( value: &str ) -> Result<Uint<BITS>, <Uint<BITS> as TryFrom<&str>>::Error>

Performs the conversion.
source§

impl<const BITS: usize> Copy for Uint<BITS>

source§

impl<const BITS: usize> Eq for Uint<BITS>

source§

impl<const BITS: usize> StructuralEq for Uint<BITS>

source§

impl<const BITS: usize> StructuralPartialEq for Uint<BITS>

Auto Trait Implementations§

§

impl<const BITS: usize> RefUnwindSafe for Uint<BITS>

§

impl<const BITS: usize> Send for Uint<BITS>

§

impl<const BITS: usize> Sync for Uint<BITS>

§

impl<const BITS: usize> Unpin for Uint<BITS>

§

impl<const BITS: usize> UnwindSafe for Uint<BITS>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,