Trait Currency
pub trait Currency:
Display
+ FromStr<Err = GeneralError>
+ Default
+ PartialEq
+ Eq {
const NAME: &'static str;
const SCALE: usize;
// Provided methods
fn is<C>() -> bool
where C: Currency { ... }
fn name_matches(s: &str) -> Result<(), GeneralError> { ... }
}
Expand description
Represents a general currency - like a token or a coin.
Required Associated Constants§
Provided Methods§
fn is<C>() -> boolwhere
C: Currency,
fn is<C>() -> boolwhere
C: Currency,
Checks if this currency is the same as the one given in the template argument.
fn name_matches(s: &str) -> Result<(), GeneralError>
fn name_matches(s: &str) -> Result<(), GeneralError>
Returns Ok(())
if the given string is equal to the currency name.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.