embedded_shadow/
lib.rs

1//! A `no_std`, no-alloc shadow register table for embedded systems.
2//! 
3//! This crate provides efficient shadow register management with dirty tracking,
4//! suitable for memory-mapped I/O, peripheral register caching, and state synchronization
5//! between application and hardware layers.
6//! 
7//! # Features
8//! 
9//! - **Zero heap allocation** - All storage statically allocated
10//! - **Block-based dirty tracking** - Efficiently track modifications
11//! - **Dual access patterns** - Host (application) and Kernel (hardware) views
12//! - **Flexible policies** - Customizable access control and persistence
13//! - **Transactional writes** - Optional staging with commit/rollback
14//! 
15//! # Example
16//! 
17//! ```rust,no_run
18//! use embedded_shadow::prelude::*;
19//! 
20//! let storage = ShadowStorageBuilder::new()
21//!     .total_size::<1024>()
22//!     .block_size::<64>()
23//!     .block_count::<16>()
24//!     .default_access()
25//!     .no_persist()
26//!     .build();
27//! ```
28
29#![deny(unsafe_code)]
30#![no_std]
31
32pub mod builder;
33pub mod error;
34pub mod helpers;
35pub mod persist;
36pub mod policy;
37pub mod shadow;
38pub mod staged;
39pub mod storage;
40pub mod table;
41pub mod types;
42pub mod view;
43
44pub use builder::ShadowStorageBuilder;
45pub use error::ShadowError;
46pub use persist::{NoPersist, PersistTrigger};
47pub use policy::{AccessPolicy, AllowAllPolicy, NoPersistPolicy, PersistPolicy};
48pub use staged::PatchStagingBuffer;
49pub use storage::ShadowStorage;
50pub use types::StagingBuffer;
51pub use view::HostView;
52
53pub mod prelude {
54    pub use crate::{
55        builder::ShadowStorageBuilder,
56        error::ShadowError,
57        persist::{NoPersist, PersistTrigger},
58        policy::{AccessPolicy, AllowAllPolicy, NoPersistPolicy, PersistPolicy},
59        staged::PatchStagingBuffer,
60        storage::ShadowStorage,
61        types::StagingBuffer,
62        view::HostView,
63    };
64}