Skip to main content

MemoryRuntime

Struct MemoryRuntime 

Source
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>

Source

pub fn new(memory: M) -> Result<Self, RuntimeConstructionError>
where M: MemoryBacking,

Claim backing and create or read its owned directory. Never reset nonempty backing.

Source

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.

Source

pub const fn is_bootstrapped(&self) -> bool

Whether current host authority has been committed.

Source

pub fn committed_generation(&self) -> Result<u64, RuntimeOpenError>

Current durable directory generation, after bootstrap admission.

Source

pub const fn config(&self) -> StorageConfig

Effective resource admission limits.

Source

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.

Source

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.

Source

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.

Source

pub fn verify_authority( &self, requirements: &SealedDeclarationSnapshot, authority: &str, ) -> Result<(), RuntimeOpenError>

Verify component requirements against current host admission without IO.

Source

pub fn allocation_id(&self, key: &StableKey) -> Option<AllocationId>

Resolve a retained identity for diagnostics; this grants no access.

Source

pub fn memory_allocations( &self, ) -> Result<Vec<MemoryAllocation>, DirectoryError>

Observe checked directory entries and actual logical extents.

Auto Trait Implementations§

§

impl<M> !RefUnwindSafe for MemoryRuntime<M>

§

impl<M> !Send for MemoryRuntime<M>

§

impl<M> !Sync for MemoryRuntime<M>

§

impl<M> !UnwindSafe for MemoryRuntime<M>

§

impl<M> Freeze for MemoryRuntime<M>
where Owner<M>: Freeze,

§

impl<M> Unpin for MemoryRuntime<M>
where Owner<M>: Unpin,

§

impl<M> UnsafeUnpin for MemoryRuntime<M>
where Owner<M>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.