pub struct Host { /* private fields */ }Implementations§
Source§impl Host
impl Host
Sourcepub fn derive_context(
&self,
root: Id,
parent: Id,
call: Option<Id>,
key: ContextContract,
value: ContextValue,
) -> Result<Id>
pub fn derive_context( &self, root: Id, parent: Id, call: Option<Id>, key: ContextContract, value: ContextValue, ) -> Result<Id>
Derive a frame retained by its creator and admitted consumers.
Sourcepub fn context_value(
&self,
root: Id,
frame: Id,
key: &ContextContract,
) -> Result<Option<ContextValue>>
pub fn context_value( &self, root: Id, frame: Id, key: &ContextContract, ) -> Result<Option<ContextValue>>
Read the nearest binding and refuse a mismatched contract.
Sourcepub fn context_stats(&self) -> (usize, usize, usize)
pub fn context_stats(&self) -> (usize, usize, usize)
Read live frames, peak frames and retained key contracts.
Source§impl Host
impl Host
Sourcepub fn begin_root(&self, principal: impl Into<String>) -> Result<Id>
pub fn begin_root(&self, principal: impl Into<String>) -> Result<Id>
Pin the current implementation version for a new operation root.
Sourcepub fn cleanup_root(&self, principal: impl Into<String>) -> Result<Id>
pub fn cleanup_root(&self, principal: impl Into<String>) -> Result<Id>
Cleanup roots may call already-live dependencies during orderly shutdown.
Sourcepub fn check_root(&self, root: Id) -> Result<()>
pub fn check_root(&self, root: Id) -> Result<()>
Require an active root that has not been cancelled.
Sourcepub fn end_root(&self, root: Id) -> Result<()>
pub fn end_root(&self, root: Id) -> Result<()>
End logical admission while physical calls retain the root.
Sourcepub fn cancel_root(&self, root: Id) -> Result<()>
pub fn cancel_root(&self, root: Id) -> Result<()>
Emit cancellation once without ending physical calls.
Sourcepub fn root_principal(&self, root: Id) -> Result<String>
pub fn root_principal(&self, root: Id) -> Result<String>
Read the identity retained by an active root.
Sourcepub fn begin_call(
&self,
reference: Id,
root: Id,
method: &str,
) -> Result<Invocation>
pub fn begin_call( &self, reference: Id, root: Id, method: &str, ) -> Result<Invocation>
Admits one physical call against its root’s retained implementation version. Refuses roots older than the object’s minimum version before retaining a call.
Sourcepub fn begin_call_with_context(
&self,
reference: Id,
root: Id,
method: &str,
frame: Id,
) -> Result<Invocation>
pub fn begin_call_with_context( &self, reference: Id, root: Id, method: &str, frame: Id, ) -> Result<Invocation>
Admit one call with its own immutable frame.
Sourcepub fn finish_call(&self, call: Id) -> Result<()>
pub fn finish_call(&self, call: Id) -> Result<()>
Marks actual callback settlement, independently from logical cancellation or caller release.
Sourcepub fn invocation(&self, call: Id) -> Result<Invocation>
pub fn invocation(&self, call: Id) -> Result<Invocation>
Read the record for a physically active call.
Sourcepub fn begin_operation(
&self,
orb: Id,
root: Id,
operation: Id,
object: Option<Id>,
) -> Result<Invocation>
pub fn begin_operation( &self, orb: Id, root: Id, operation: Id, object: Option<Id>, ) -> Result<Invocation>
Enters an orb-owned operation such as a hook contribution without exposing a service.
Sourcepub fn begin_operation_with_context(
&self,
orb: Id,
root: Id,
operation: Id,
object: Option<Id>,
frame: Id,
) -> Result<Invocation>
pub fn begin_operation_with_context( &self, orb: Id, root: Id, operation: Id, object: Option<Id>, frame: Id, ) -> Result<Invocation>
Admit an orb operation with its caller’s frame.
Source§impl Host
impl Host
Sourcepub fn allocate_handle(&self) -> Result<Id>
pub fn allocate_handle(&self) -> Result<Id>
Sourcepub fn disposed(&self, object: Id) -> Result<()>
pub fn disposed(&self, object: Id) -> Result<()>
Completes adapter cleanup. In-flight calls/tasks and owned resources must already settle.
Sourcepub fn now(&self) -> u64
pub fn now(&self) -> u64
Read the last accepted monotonic clock value for adapter synchronization.
Sourcepub fn tick(&self, now: u64) -> Result<()>
pub fn tick(&self, now: u64) -> Result<()>
Advances adapter-provided monotonic time and admits expired idle disposal.
Sourcepub fn close(&self)
pub fn close(&self)
Stops admissions and cancels pending reloads. Their scopes remain reserved until physical
effects settle; cleanup then runs in dependency order. Call finish_close after draining.
Sourcepub fn finish_close(&self) -> Result<()>
pub fn finish_close(&self) -> Result<()>
Release kernel storage only after physical ownership settles.
Sourcepub fn diagnostics(&self) -> Diagnostics
pub fn diagnostics(&self) -> Diagnostics
Count retained kernel records without activating services.
Source§impl Host
impl Host
Sourcepub fn commit(&self, ticket: Id, migrations: Vec<Migration>) -> Result<Version>
pub fn commit(&self, ticket: Id, migrations: Vec<Migration>) -> Result<Version>
Adopts declarations and private migrated states in one synchronous step.
§Guarantees
All refusal checks precede adoption. Failure preserves installed declarations and state. Compatible services keep their object identities and state when their provider orb changes. Adapter I/O, resource handoffs and other external effects are outside this guarantee.
§Errors
Refuses a foreign ticket, busy gates, missing gates, stale revisions or invalid migrations.
Source§impl Host
impl Host
Sourcepub fn gate(&self, ticket: Id, objects: &[Id]) -> Result<bool>
pub fn gate(&self, ticket: Id, objects: &[Id]) -> Result<bool>
Stops first access by old roots while allowing already admitted roots to reenter. Returns true only after their complete roots and owned tasks physically settle. Ending or cancelling a root does not release its lease while a callback is still running.
Source§impl Host
impl Host
Sourcepub fn installed_orbs(&self) -> Vec<InstalledOrb>
pub fn installed_orbs(&self) -> Vec<InstalledOrb>
Describe the orbs in the current implementation version.
Sourcepub fn orb(&self, id: Id) -> Result<InstalledOrb>
pub fn orb(&self, id: Id) -> Result<InstalledOrb>
Read metadata for a retained orb identity.
Sourcepub fn orb_named(&self, name: &str) -> Result<InstalledOrb>
pub fn orb_named(&self, name: &str) -> Result<InstalledOrb>
Resolves one current declaration without enumerating unrelated installed orbs.
Sourcepub fn prepared_orb(&self, ticket: Id, name: &str) -> Result<InstalledOrb>
pub fn prepared_orb(&self, ticket: Id, name: &str) -> Result<InstalledOrb>
Resolves a declaration in an isolated candidate without changing installed lookups.
§Errors
Refuses stale or foreign tickets and orb names absent from the candidate.
Source§impl Host
impl Host
Sourcepub fn object_address(&self, object: Id) -> Result<Address>
pub fn object_address(&self, object: Id) -> Result<Address>
Read the canonical address of a retained object.
Sourcepub fn acquire(
&self,
address: Address,
api_version: Version,
methods: BTreeSet<String>,
) -> Result<Acquisition>
pub fn acquire( &self, address: Address, api_version: Version, methods: BTreeSet<String>, ) -> Result<Acquisition>
Acquires an independent claim. Cloning its numeric identity does not create another claim. A disposing object is never resurrected or overlapped at the same address. New instances require roots from their creation version or later; reacquisition preserves an existing instance’s minimum version.
Sourcepub fn ready(&self, object: Id) -> Result<()>
pub fn ready(&self, object: Id) -> Result<()>
Publish successful activation and wake dependent scopes.
Sourcepub fn dependency(&self, object: Id, reference: Id) -> Result<()>
pub fn dependency(&self, object: Id, reference: Id) -> Result<()>
Retains an object-owned dependency and rejects local dependency cycles before activation.
Sourcepub fn fail(&self, object: Id) -> Result<()>
pub fn fail(&self, object: Id) -> Result<()>
Retire a failed activation and wake its dependents.
Sourcepub fn detach_dependency(&self, object: Id, reference: Id) -> Result<()>
pub fn detach_dependency(&self, object: Id, reference: Id) -> Result<()>
Remove an object’s dependency claim and reverse membership.
Sourcepub fn status(&self, reference: Id) -> Result<Status>
pub fn status(&self, reference: Id) -> Result<Status>
Read the reference’s current lifecycle status.
Sourcepub fn release(&self, reference: Id) -> Result<()>
pub fn release(&self, reference: Id) -> Result<()>
Release one claim and reconsider object retirement.
Sourcepub fn forget_reference(&self, reference: Id) -> Result<()>
pub fn forget_reference(&self, reference: Id) -> Result<()>
Releases a terminal reference record after the adapter has revoked every public handle.
Source§impl Host
impl Host
Sourcepub fn resource(
&self,
owner: Owner,
name: String,
version: Version,
exclusive: bool,
dependencies: Vec<Id>,
) -> Result<Resource>
pub fn resource( &self, owner: Owner, name: String, version: Version, exclusive: bool, dependencies: Vec<Id>, ) -> Result<Resource>
Resolve a named resource under its declaration owner.
Sourcepub fn resource_opened(&self, resource: Id, value: Id) -> Result<()>
pub fn resource_opened(&self, resource: Id, value: Id) -> Result<()>
Publish the value after its physical opener settles.
Sourcepub fn resource_value(&self, resource: Id) -> Result<Id>
pub fn resource_value(&self, resource: Id) -> Result<Id>
Read an opened resource value or reject unavailable storage.
Sourcepub fn close_resource(&self, resource: Id) -> Result<bool>
pub fn close_resource(&self, resource: Id) -> Result<bool>
Requests closure only after every resource dependent has closed.
Sourcepub fn close_resource_before(
&self,
resource: Id,
before: Option<Version>,
) -> Result<bool>
pub fn close_resource_before( &self, resource: Id, before: Option<Version>, ) -> Result<bool>
Retiring adapters may exclude successor invocations, which cannot use this resource.
Sourcepub fn resource_closed(&self, resource: Id) -> Result<()>
pub fn resource_closed(&self, resource: Id) -> Result<()>
Remove the resource and wake its indexed dependents.
Source§impl Host
impl Host
Sourcepub fn begin_task(&self, owner: Owner) -> Result<Id>
pub fn begin_task(&self, owner: Owner) -> Result<Id>
Retain an owner’s implementation version for physical task work.
Sourcepub fn task_root(&self, task: Id, principal: impl Into<String>) -> Result<Id>
pub fn task_root(&self, task: Id, principal: impl Into<String>) -> Result<Id>
Issue an operation root under a live task’s retained version.
Sourcepub fn stop_task(&self, task: Id) -> Result<()>
pub fn stop_task(&self, task: Id) -> Result<()>
Request task cancellation without releasing its ownership.
Sourcepub fn finish_task(&self, task: Id) -> Result<()>
pub fn finish_task(&self, task: Id) -> Result<()>
Release physical task ownership and wake dependent cleanup.
Source§impl Host
impl Host
Sourcepub fn reload_registered_scopes(
&self,
ticket: Id,
deadline_ms: u64,
) -> Result<Id>
pub fn reload_registered_scopes( &self, ticket: Id, deadline_ms: u64, ) -> Result<Id>
Builds the shared reload policy after language factories have reported their declarations.
The deadline starts at this host’s most recent Host::tick.
Sourcepub fn reload_scopes(
&self,
ticket: Id,
replacements: Vec<Replacement>,
deadline_ms: u64,
) -> Result<Id>
pub fn reload_scopes( &self, ticket: Id, replacements: Vec<Replacement>, deadline_ms: u64, ) -> Result<Id>
Accepts explicit pairs for native integrations with independently declared scopes.
The deadline starts at this host’s most recent Host::tick.
Sourcepub fn commit_program(&self, id: Id) -> Result<()>
pub fn commit_program(&self, id: Id) -> Result<()>
Admit publication of a fully prepared replacement.
Sourcepub fn abort_program(&self, id: Id) -> Result<()>
pub fn abort_program(&self, id: Id) -> Result<()>
Start recovery without claiming pending callbacks have stopped.
Source§impl Host
impl Host
Sourcepub fn next_step(&self, id: Id) -> Result<Step>
pub fn next_step(&self, id: Id) -> Result<Step>
Advance one program and update its indexed wait memberships.
Sourcepub fn forget_program(&self, id: Id) -> Result<()>
pub fn forget_program(&self, id: Id) -> Result<()>
Remove a program only after it reaches a terminal phase.
Sourcepub fn run_program(&self, id: Id) -> Result<()>
pub fn run_program(&self, id: Id) -> Result<()>
Mark a program runnable without executing language callbacks.
Sourcepub fn next_deadline(&self) -> Option<u64>
pub fn next_deadline(&self) -> Option<u64>
Absolute monotonic deadline; adapters can retain an unchanged scheduled timer.
Source§impl Host
impl Host
Sourcepub fn register_scope(&self, scope: Scope) -> Result<()>
pub fn register_scope(&self, scope: Scope) -> Result<()>
Validate ownership and index a declared scope’s memberships.
Sourcepub fn activate_scope(&self, scope: Id) -> Result<Id>
pub fn activate_scope(&self, scope: Id) -> Result<Id>
Activates a scope, suspending on indexed resource readiness when another program opens a dependency.
Sourcepub fn scope_exists(&self, id: Id) -> bool
pub fn scope_exists(&self, id: Id) -> bool
Check whether a scope remains registered.
Sourcepub fn scopes_for_owner(&self, owner: Owner) -> Vec<Id> ⓘ
pub fn scopes_for_owner(&self, owner: Owner) -> Vec<Id> ⓘ
Read only scopes indexed under this owner.
Source§impl Host
impl Host
Sourcepub fn complete_step(&self, id: Id, results: Vec<Completion>) -> Result<()>
pub fn complete_step(&self, id: Id, results: Vec<Completion>) -> Result<()>
Acknowledges only physical execution settlement. Observer cancellation is not completion.
Source§impl Host
impl Host
Sourcepub fn initialize_state(
&self,
object: Id,
value: Id,
version: Version,
) -> Result<Snapshot>
pub fn initialize_state( &self, object: Id, value: Id, version: Version, ) -> Result<Snapshot>
Attach initial state once while the object is loading.
Sourcepub fn snapshot(&self, object: Id) -> Result<Snapshot>
pub fn snapshot(&self, object: Id) -> Result<Snapshot>
Read state metadata without decoding the adapter-owned value.
Sourcepub fn prepare_state(
&self,
call: Id,
object: Id,
expected: u64,
value: Id,
) -> Result<PreparedState>
pub fn prepare_state( &self, call: Id, object: Id, expected: u64, value: Id, ) -> Result<PreparedState>
Captures the revision before adapter code prepares and validates a candidate.