Skip to main content

Host

Struct Host 

Source
pub struct Host { /* private fields */ }

Implementations§

Source§

impl Host

Source

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.

Source

pub fn context_value( &self, root: Id, frame: Id, key: &ContextContract, ) -> Result<Option<ContextValue>>

Read the nearest binding and refuse a mismatched contract.

Source

pub fn context_stats(&self) -> (usize, usize, usize)

Read live frames, peak frames and retained key contracts.

Source§

impl Host

Source

pub fn begin_root(&self, principal: impl Into<String>) -> Result<Id>

Pin the current implementation version for a new operation root.

Source

pub fn cleanup_root(&self, principal: impl Into<String>) -> Result<Id>

Cleanup roots may call already-live dependencies during orderly shutdown.

Source

pub fn check_root(&self, root: Id) -> Result<()>

Require an active root that has not been cancelled.

Source

pub fn end_root(&self, root: Id) -> Result<()>

End logical admission while physical calls retain the root.

Source

pub fn cancel_root(&self, root: Id) -> Result<()>

Emit cancellation once without ending physical calls.

Source

pub fn root_principal(&self, root: Id) -> Result<String>

Read the identity retained by an active root.

Source

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.

Source

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.

Source

pub fn finish_call(&self, call: Id) -> Result<()>

Marks actual callback settlement, independently from logical cancellation or caller release.

Source

pub fn invocation(&self, call: Id) -> Result<Invocation>

Read the record for a physically active call.

Source

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.

Source

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

Source

pub fn allocate_handle(&self) -> Result<Id>

Reserves one opaque adapter value, callback or source identity in the host’s namespace.

§Errors

After MAX_ID is issued, returns exhausted/identities without advancing the counter.

Source

pub fn new() -> Self

Create an empty kernel with no platform dependencies.

Source

pub fn disposed(&self, object: Id) -> Result<()>

Completes adapter cleanup. In-flight calls/tasks and owned resources must already settle.

Source

pub fn next_idle(&self) -> Option<u64>

Read the earliest indexed object retirement deadline.

Source

pub fn now(&self) -> u64

Read the last accepted monotonic clock value for adapter synchronization.

Source

pub fn tick(&self, now: u64) -> Result<()>

Advances adapter-provided monotonic time and admits expired idle disposal.

Source

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.

Source

pub fn finish_close(&self) -> Result<()>

Release kernel storage only after physical ownership settles.

Source

pub fn drain(&self) -> Vec<Action>

Advance ready work and return pending adapter actions.

Source

pub fn diagnostics(&self) -> Diagnostics

Count retained kernel records without activating services.

Source§

impl Host

Source

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

pub fn abort(&self, ticket: Id) -> Result<()>

Abandons preparation and reopens its gates. Candidate values remain adapter-owned.

Source§

impl Host

Source

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

pub fn gate_orbs(&self, ticket: Id, owners: &[Id]) -> Result<bool>

Drains an exclusive orb-owned resource, including hook invocations without an object.

Source§

impl Host

Source

pub fn prepare( &self, declarations: Vec<Orb>, remove: Vec<String>, ) -> Result<Reload>

Check a replacement without changing installed state. Reject concurrent preparation and incompatible declarations.

Source§

impl Host

Source

pub fn installed_orbs(&self) -> Vec<InstalledOrb>

Describe the orbs in the current implementation version.

Source

pub fn orb(&self, id: Id) -> Result<InstalledOrb>

Read metadata for a retained orb identity.

Source

pub fn orb_named(&self, name: &str) -> Result<InstalledOrb>

Resolves one current declaration without enumerating unrelated installed orbs.

Source

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

pub fn version(&self) -> Version

Read the published implementation version.

Source§

impl Host

Source

pub fn object_address(&self, object: Id) -> Result<Address>

Read the canonical address of a retained object.

Source

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.

Source

pub fn ready(&self, object: Id) -> Result<()>

Publish successful activation and wake dependent scopes.

Source

pub fn dependency(&self, object: Id, reference: Id) -> Result<()>

Retains an object-owned dependency and rejects local dependency cycles before activation.

Source

pub fn fail(&self, object: Id) -> Result<()>

Retire a failed activation and wake its dependents.

Source

pub fn detach_dependency(&self, object: Id, reference: Id) -> Result<()>

Remove an object’s dependency claim and reverse membership.

Source

pub fn status(&self, reference: Id) -> Result<Status>

Read the reference’s current lifecycle status.

Source

pub fn reference_methods(&self, reference: Id) -> Result<BTreeSet<String>>

Read declared methods admitted by this claim’s requirements and current view restrictions. This metadata is not call admission: lifecycle, version and context checks still run per call.

§Errors

Returns a reference or object error if the claim has been released or its owner is gone.

Source

pub fn release(&self, reference: Id) -> Result<()>

Release one claim and reconsider object retirement.

Source

pub fn forget_reference(&self, reference: Id) -> Result<()>

Releases a terminal reference record after the adapter has revoked every public handle.

Source§

impl Host

Source

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.

Source

pub fn resource_opened(&self, resource: Id, value: Id) -> Result<()>

Publish the value after its physical opener settles.

Source

pub fn resource_value(&self, resource: Id) -> Result<Id>

Read an opened resource value or reject unavailable storage.

Source

pub fn close_resource(&self, resource: Id) -> Result<bool>

Requests closure only after every resource dependent has closed.

Source

pub fn close_resource_before( &self, resource: Id, before: Option<Version>, ) -> Result<bool>

Retiring adapters may exclude successor invocations, which cannot use this resource.

Source

pub fn resource_closed(&self, resource: Id) -> Result<()>

Remove the resource and wake its indexed dependents.

Source§

impl Host

Source

pub fn begin_task(&self, owner: Owner) -> Result<Id>

Retain an owner’s implementation version for physical task work.

Source

pub fn task_root(&self, task: Id, principal: impl Into<String>) -> Result<Id>

Issue an operation root under a live task’s retained version.

Source

pub fn stop_task(&self, task: Id) -> Result<()>

Request task cancellation without releasing its ownership.

Source

pub fn finish_task(&self, task: Id) -> Result<()>

Release physical task ownership and wake dependent cleanup.

Source§

impl Host

Source

pub fn cleanup_scopes(&self, scopes: Vec<Id>, object: Option<Id>) -> Result<Id>

Create a cleanup program for the supplied owned scopes.

Source§

impl Host

Source

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.

Source

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.

Source

pub fn commit_program(&self, id: Id) -> Result<()>

Admit publication of a fully prepared replacement.

Source

pub fn abort_program(&self, id: Id) -> Result<()>

Start recovery without claiming pending callbacks have stopped.

Source§

impl Host

Source

pub fn next_step(&self, id: Id) -> Result<Step>

Advance one program and update its indexed wait memberships.

Source

pub fn forget_program(&self, id: Id) -> Result<()>

Remove a program only after it reaches a terminal phase.

Source

pub fn run_program(&self, id: Id) -> Result<()>

Mark a program runnable without executing language callbacks.

Source

pub fn next_wake(&self) -> Option<u64>

Read the delay until the earliest indexed deadline.

Source

pub fn next_deadline(&self) -> Option<u64>

Absolute monotonic deadline; adapters can retain an unchanged scheduled timer.

Source§

impl Host

Source

pub fn register_scope(&self, scope: Scope) -> Result<()>

Validate ownership and index a declared scope’s memberships.

Source

pub fn activate_scope(&self, scope: Id) -> Result<Id>

Activates a scope, suspending on indexed resource readiness when another program opens a dependency.

Source

pub fn scope_exists(&self, id: Id) -> bool

Check whether a scope remains registered.

Source

pub fn scopes_for_owner(&self, owner: Owner) -> Vec<Id> ⓘ

Read only scopes indexed under this owner.

Source

pub fn scopes_for_orb(&self, orb: Id) -> Vec<Id> ⓘ

Read only scopes indexed under this orb version.

Source

pub fn add_scope_resource(&self, scope: Id, resource: Id) -> Result<()>

Attach a same-owner resource and update version claims.

Source§

impl Host

Source

pub fn complete_step(&self, id: Id, results: Vec<Completion>) -> Result<()>

Acknowledges only physical execution settlement. Observer cancellation is not completion.

Source§

impl Host

Source

pub fn initialize_state( &self, object: Id, value: Id, version: Version, ) -> Result<Snapshot>

Attach initial state once while the object is loading.

Source

pub fn snapshot(&self, object: Id) -> Result<Snapshot>

Read state metadata without decoding the adapter-owned value.

Source

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.

Source

pub fn adopt_state( &self, call: Id, object: Id, expected: u64, value: Id, ) -> Result<Snapshot>

Check and adopt a candidate against its expected revision.

Trait Implementations§

Source§

impl Clone for Host

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for Host

Source§

fn default() -> Self

Create a fresh platform-independent kernel.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Host

§

impl !Send for Host

§

impl !Sync for Host

§

impl !UnwindSafe for Host

§

impl Forget for Host

§

impl Freeze for Host

§

impl Unpin for Host

§

impl UnsafeUnpin for Host

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.