Crate near_gas

source ·
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 by borsh.

  • serde (optional) - When enabled allows NearGas to serialized and deserialized by serde.

  • schemars (optional) - Implements schemars::JsonSchema for NearGas.

  • interactive-clap (optional) - Implements interactive_clap::ToCli for NearGas.

Structs§

Enums§