pub trait Currency:
Display
+ FromStr<Err = GeneralError>
+ Default
+ PartialEq
+ Eq {
const NAME: &'static str;
const SCALE: usize;
// Provided methods
fn is<C: Currency>() -> bool { ... }
fn name_matches(s: &str) -> Result<(), GeneralError> { ... }
}
Expand description
Represents a general currency - like a token or a coin.
Required Associated Constants§
Provided Methods§
Sourcefn is<C: Currency>() -> bool
fn is<C: Currency>() -> bool
Checks if this currency is the same as the one given in the template argument.
Sourcefn 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.