pub enum AssetError {
Serialization(String),
Parsing(String),
ZeroAmount,
MissingId,
MissingTotalSupply,
InvalidId,
InvalidShare(BigNumber, BigNumber),
InvalidDecimals(u8),
FormatOverflow(BigNumber, u8),
UnsupportedFormat,
ParseInt(ParseIntError),
}Expand description
Errors related to asset parsing, validation, or formatting.
Variants§
Serialization(String)
Failed to parse an asset from a string or JSON.
Parsing(String)
Failed to parse an asset from bytes or JSON.
ZeroAmount
A fungible or multi-token amount and/or total supply was zero, which is not allowed.
MissingId
ID for asset, program, or contract not provided.
MissingTotalSupply
Total supply of token not provided.
InvalidId
Invalid ID for asset, program, or contract.
A liquidity pool share was invalid;
share must be > 0 and <= total supply.
InvalidDecimals(u8)
The specified number of decimals was invalid.
FormatOverflow(BigNumber, u8)
Fixed-point formatting overflow (e.g., amount or decimals too large).
UnsupportedFormat
The provided asset string did not match a supported format.
ParseInt(ParseIntError)
Error parsing an integer (e.g., token ID or amount) from a string.
Trait Implementations§
Source§impl Debug for AssetError
impl Debug for AssetError
Source§impl Display for AssetError
impl Display for AssetError
Source§impl Error for AssetError
impl Error for AssetError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<AssetError> for EscrowError
impl From<AssetError> for EscrowError
Source§fn from(source: AssetError) -> Self
fn from(source: AssetError) -> Self
Converts to this type from the input type.
Source§impl From<ParseIntError> for AssetError
impl From<ParseIntError> for AssetError
Source§fn from(source: ParseIntError) -> Self
fn from(source: ParseIntError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for AssetError
impl RefUnwindSafe for AssetError
impl Send for AssetError
impl Sync for AssetError
impl Unpin for AssetError
impl UnwindSafe for AssetError
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