pub struct ShadowStorageBase<const TS: usize, const BS: usize, const BC: usize, AP, PP, PT, PK, SS>{ /* private fields */ }Expand description
Core shadow table storage with configurable policies.
§Const Generics
TS: Total size of the shadow table in bytesBS: Block size in bytes for dirty tracking granularityBC: Block count (must equalTS / BS)
§Type Parameters
AP: Access policy controlling read/write permissionsPP: Persist policy determining what needs persistencePT: Persist trigger receiving persistence requestsPK: Persist key type used to identify regionsSS: Stage state (NoStageorWithStage<SB>)
Implementations§
Source§impl<const TS: usize, const BS: usize, const BC: usize, AP, PP, PT, PK> ShadowStorageBase<TS, BS, BC, AP, PP, PT, PK, NoStage>
impl<const TS: usize, const BS: usize, const BC: usize, AP, PP, PT, PK> ShadowStorageBase<TS, BS, BC, AP, PP, PT, PK, NoStage>
pub fn new(policy: AP, persist: PP, trigger: PT) -> Self
Sourcepub fn with_staging<SB: StagingBuffer>(
self,
sb: SB,
) -> ShadowStorageBase<TS, BS, BC, AP, PP, PT, PK, WithStage<SB>>
pub fn with_staging<SB: StagingBuffer>( self, sb: SB, ) -> ShadowStorageBase<TS, BS, BC, AP, PP, PT, PK, WithStage<SB>>
Upgrade this storage to staged mode by supplying a staging implementation.
Source§impl<const TS: usize, const BS: usize, const BC: usize, AP, PP, PT, PK, SS> ShadowStorageBase<TS, BS, BC, AP, PP, PT, PK, SS>
impl<const TS: usize, const BS: usize, const BC: usize, AP, PP, PT, PK, SS> ShadowStorageBase<TS, BS, BC, AP, PP, PT, PK, SS>
pub fn host_shadow(&self) -> HostShadow<'_, TS, BS, BC, AP, PP, PT, PK, SS>
pub fn kernel_shadow(&self) -> KernelShadow<'_, TS, BS, BC, AP, PP, PT, PK, SS>
Sourcepub unsafe fn load_defaults_unchecked(
&self,
f: impl FnOnce(&mut WriteFn) -> Result<(), ShadowError>,
) -> Result<(), ShadowError>
pub unsafe fn load_defaults_unchecked( &self, f: impl FnOnce(&mut WriteFn) -> Result<(), ShadowError>, ) -> Result<(), ShadowError>
Load initial values into the shadow table without marking dirty.
Use this during system initialization to populate the shadow with factory defaults or restored EEPROM data.
§Safety
Caller must ensure exclusive access to the storage. Typically safe during boot before interrupts are enabled.
Sourcepub fn load_defaults(
&self,
f: impl FnOnce(&mut WriteFn) -> Result<(), ShadowError>,
) -> Result<(), ShadowError>
pub fn load_defaults( &self, f: impl FnOnce(&mut WriteFn) -> Result<(), ShadowError>, ) -> Result<(), ShadowError>
Load initial values into the shadow table without marking dirty.
Wraps Self::load_defaults_unchecked in a critical section.
Use this during system initialization to populate the shadow with factory defaults or restored EEPROM data.
Auto Trait Implementations§
impl<const TS: usize, const BS: usize, const BC: usize, AP, PP, PT, PK, SS> !Freeze for ShadowStorageBase<TS, BS, BC, AP, PP, PT, PK, SS>
impl<const TS: usize, const BS: usize, const BC: usize, AP, PP, PT, PK, SS> !RefUnwindSafe for ShadowStorageBase<TS, BS, BC, AP, PP, PT, PK, SS>
impl<const TS: usize, const BS: usize, const BC: usize, AP, PP, PT, PK, SS> !Send for ShadowStorageBase<TS, BS, BC, AP, PP, PT, PK, SS>
impl<const TS: usize, const BS: usize, const BC: usize, AP, PP, PT, PK, SS> !Sync for ShadowStorageBase<TS, BS, BC, AP, PP, PT, PK, SS>
impl<const TS: usize, const BS: usize, const BC: usize, AP, PP, PT, PK, SS> !Unpin for ShadowStorageBase<TS, BS, BC, AP, PP, PT, PK, SS>
impl<const TS: usize, const BS: usize, const BC: usize, AP, PP, PT, PK, SS> !UnwindSafe for ShadowStorageBase<TS, BS, BC, AP, PP, PT, PK, SS>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more