fuel_types/
lib.rs

1//! Atomic types of the FuelVM.
2
3#![cfg_attr(not(feature = "std"), no_std)]
4#![warn(unsafe_code)]
5#![warn(missing_docs)]
6#![deny(unused_crate_dependencies)]
7#![deny(
8    clippy::arithmetic_side_effects,
9    clippy::cast_sign_loss,
10    clippy::cast_possible_truncation,
11    clippy::cast_possible_wrap,
12    clippy::string_slice
13)]
14// `fuel-derive` requires `fuel_types` import
15// TODO: Move canonical serialization to `fuel-canonical` crate
16#![allow(unused_crate_dependencies)]
17extern crate self as fuel_types;
18
19#[cfg(feature = "alloc")]
20extern crate alloc;
21extern crate core;
22
23pub mod canonical;
24
25mod array_types;
26#[cfg(feature = "alloc")]
27mod fmt;
28mod numeric_types;
29
30pub use array_types::*;
31#[cfg(feature = "alloc")]
32pub use fmt::*;
33pub use numeric_types::*;
34
35/// Word-aligned bytes serialization functions.
36pub mod bytes;
37
38#[cfg(test)]
39mod tests;
40
41/// Register ID type
42pub type RegisterId = usize;
43
44/// Register value type
45pub type Word = u64;
46
47/// 6-bits immediate value type
48pub type Immediate06 = u8;
49
50/// 12-bits immediate value type
51pub type Immediate12 = u16;
52
53/// 18-bits immediate value type
54pub type Immediate18 = u32;
55
56/// 24-bits immediate value type
57pub type Immediate24 = u32;