pub enum Allowance {
Max,
Amount(Decimal),
Unknown(String),
}Expand description
An ERC20 allowance as reported by /v1/approvals.
Upstream sends a string that is either the sentinel "max" or a decimal
amount in the token’s base units. ERC1155 entries carry no amount at all,
which is represented by Option::None on the containing field rather than
by a variant here.
Variants§
Max
The unlimited-allowance sentinel ("max").
Amount(Decimal)
A concrete allowance, in the token’s base units.
Unknown(String)
A value that is neither "max" nor a decimal rust_decimal can hold,
preserved verbatim.
rust_decimal tops out near 7.9e28 while a uint256 allowance can reach
1.2e77, so an unusually large approval lands here instead of failing
deserialization of the entire response.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Allowance
impl<'de> Deserialize<'de> for Allowance
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Allowance
impl StructuralPartialEq for Allowance
Auto Trait Implementations§
impl Freeze for Allowance
impl RefUnwindSafe for Allowance
impl Send for Allowance
impl Sync for Allowance
impl Unpin for Allowance
impl UnsafeUnpin for Allowance
impl UnwindSafe for Allowance
Blanket Implementations§
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