pub struct MemoryRuntime<M: Memory> { /* private fields */ }Expand description
MemoryRuntime
One custodian of named allocations on a backing. Bootstrap validates namespace grants and host policy, commits bindings, then permits exclusive leases. Omitted retained names keep their allocation, but require current admission before opening. IDs are opaque u64 values, never selected by applications.
Implementations§
Source§impl<M: Memory> MemoryRuntime<M>
impl<M: Memory> MemoryRuntime<M>
Sourcepub fn new(memory: M) -> Result<Self, RuntimeConstructionError>where
M: MemoryBacking,
pub fn new(memory: M) -> Result<Self, RuntimeConstructionError>where
M: MemoryBacking,
Claim backing and create or read its owned directory. Never reset nonempty backing.
Sourcepub fn new_with_config(
memory: M,
config: StorageConfig,
) -> Result<Self, RuntimeConstructionError>where
M: MemoryBacking,
pub fn new_with_config(
memory: M,
config: StorageConfig,
) -> Result<Self, RuntimeConstructionError>where
M: MemoryBacking,
Use explicit directory resource limits; reopening revalidates under those limits.
Sourcepub const fn is_bootstrapped(&self) -> bool
pub const fn is_bootstrapped(&self) -> bool
Whether current host authority has been committed.
Sourcepub fn committed_generation(&self) -> Result<u64, RuntimeOpenError>
pub fn committed_generation(&self) -> Result<u64, RuntimeOpenError>
Current durable directory generation, after bootstrap admission.
Sourcepub const fn config(&self) -> StorageConfig
pub const fn config(&self) -> StorageConfig
Effective resource admission limits.
Sourcepub fn bootstrap<P: RuntimeBootstrapPolicy>(
&mut self,
source: &SealedDeclarationSnapshot,
grants: &AllocationGrants,
policy: &P,
) -> Result<u64, RuntimeBootstrapError<P::Error>>
pub fn bootstrap<P: RuntimeBootstrapPolicy>( &mut self, source: &SealedDeclarationSnapshot, grants: &AllocationGrants, policy: &P, ) -> Result<u64, RuntimeBootstrapError<P::Error>>
Admit a complete declaration set, retaining omitted historical bindings.
Sourcepub fn verify_bootstrap<P: RuntimeBootstrapPolicy>(
&self,
source: &SealedDeclarationSnapshot,
grants: &AllocationGrants,
policy: &P,
) -> Result<u64, RuntimeBootstrapError<P::Error>>
pub fn verify_bootstrap<P: RuntimeBootstrapPolicy>( &self, source: &SealedDeclarationSnapshot, grants: &AllocationGrants, policy: &P, ) -> Result<u64, RuntimeBootstrapError<P::Error>>
Compare the complete established binding without IO or policy callbacks.
Sourcepub fn open_memory(
&self,
key: &StableKey,
) -> Result<RuntimeMemory<M>, RuntimeOpenError>
pub fn open_memory( &self, key: &StableKey, ) -> Result<RuntimeMemory<M>, RuntimeOpenError>
Open one currently admitted name, preserving custody through detached handles.
§Panics
Propagates backing failures or a broken internal binding invariant.
Verify component requirements against current host admission without IO.
Sourcepub fn allocation_id(&self, key: &StableKey) -> Option<AllocationId>
pub fn allocation_id(&self, key: &StableKey) -> Option<AllocationId>
Resolve a retained identity for diagnostics; this grants no access.
Sourcepub fn memory_allocations(
&self,
) -> Result<Vec<MemoryAllocation>, DirectoryError>
pub fn memory_allocations( &self, ) -> Result<Vec<MemoryAllocation>, DirectoryError>
Observe checked directory entries and actual logical extents.