Expand description
A NearGas
type to represent a value of Gas.
Each NearGas
is composed of a whole number of Gases.
NearGas
is implementing the common trait FromStr
. Also, have utils function to parse from str
into u64
.
§Examples
use near_gas::*;
let one_tera_gas = NearGas::from_gas(10_u64.pow(12));
assert_eq!(one_tera_gas, NearGas::from_tgas(1));
assert_eq!(one_tera_gas, NearGas::from_ggas(1000));
§Crate features
-
borsh (optional) - When enabled allows
NearGas
to serialized and deserialized byborsh
. -
serde (optional) - When enabled allows
NearGas
to serialized and deserialized byserde
. -
schemars (optional) - Implements
schemars::JsonSchema
forNearGas
. -
interactive-clap (optional) - Implements
interactive_clap::ToCli
forNearGas
.