arb_storage/
lib.rs

1//! Storage-backed types for ArbOS state.
2//!
3//! Provides typed wrappers over raw storage slots — integers, addresses,
4//! byte arrays, queues, and vectors that persist in the state trie — and
5//! re-exports the [`StorageError`] surface from [`arb_storage_errors`].
6//!
7//! All read and write paths propagate database failures as typed
8//! [`StorageError::Database`] so callers can distinguish a genuine
9//! storage-level fault from a logical condition such as "slot is zero".
10
11mod backed_types;
12mod backend;
13mod bytes_storage;
14mod extra_types;
15mod gas;
16pub mod layout;
17pub mod queue;
18mod slot;
19mod state_ops;
20mod storage;
21pub mod vector;
22
23pub use arb_storage_errors::{AnyError, DatabaseError, DatabaseErrorInfo, StorageError};
24pub use backed_types::{
25    StorageBackedAddress, StorageBackedAddressOrNil, StorageBackedBigInt, StorageBackedBigUint,
26    StorageBackedInt64, StorageBackedUint64,
27};
28pub use backend::{StorageBackend, SystemStateBackend};
29pub use bytes_storage::StorageBackedBytes;
30pub use extra_types::{
31    StorageBackedBips, StorageBackedUBips, StorageBackedUint16, StorageBackedUint24,
32    StorageBackedUint32,
33};
34pub use gas::{STORAGE_READ_GAS, STORAGE_WRITE_GAS, STORAGE_WRITE_ZERO_GAS, write_cost};
35pub use queue::{Queue, initialize_queue, open_queue};
36pub use slot::storage_key_map;
37pub use state_ops::{
38    ARBOS_STATE_ADDRESS, FILTERED_TX_STATE_ADDRESS, get_account_balance, read_storage_at,
39    set_account_code, set_account_nonce, write_arbos_storage, write_storage_at,
40};
41pub use storage::{Detached, Storage};
42pub use vector::{SubStorageVector, open_sub_storage_vector};