pub struct HostService { /* private fields */ }Expand description
Owns ordinary Agents independently of transient weak clients and request futures. No mutex protecting this registry is held during a backend await. Failed close keeps both the native owner and its resident/writer resources.
Implementations§
Source§impl HostService
impl HostService
Sourcepub fn new(catalog: HostCatalog) -> Self
pub fn new(catalog: HostCatalog) -> Self
The caller must not shut down another clone of this catalog while the service is live. Runtime and service lifetime belong to the daemon.
pub fn owner_count(&self) -> usize
pub fn phase(&self, id: AgentId) -> Option<OwnerPhase>
pub fn is_stopping(&self) -> bool
pub fn is_closed(&self) -> bool
Sourcepub async fn restore_ordinary(
&self,
id: AgentId,
guard: CatalogGuard,
limits: OrdinaryLimits,
binder: OrdinaryBinder,
) -> Result<OrdinaryClient, ServiceError>
pub async fn restore_ordinary( &self, id: AgentId, guard: CatalogGuard, limits: OrdinaryLimits, binder: OrdinaryBinder, ) -> Result<OrdinaryClient, ServiceError>
Starting is supervised even when this request is abandoned. The owner is installed in the service before returning a weak client; it is never returned as an unclaimed owner that a cancelled caller could drop.
Sourcepub async fn restore_bound(
&self,
id: AgentId,
guard: CatalogGuard,
limits: OrdinaryLimits,
binding: OrdinaryBinding,
) -> Result<OrdinaryClient, ServiceError>
pub async fn restore_bound( &self, id: AgentId, guard: CatalogGuard, limits: OrdinaryLimits, binding: OrdinaryBinding, ) -> Result<OrdinaryClient, ServiceError>
Production bindings use an explicit closed environment shared by native storage, tools and skill execution, never the legacy process baseline.
Sourcepub async fn start_mini(
&self,
id: AgentId,
guard: CatalogGuard,
profile: NativeBindingProfile,
limits: MiniLimits,
) -> Result<MiniClient, ServiceError>
pub async fn start_mini( &self, id: AgentId, guard: CatalogGuard, profile: NativeBindingProfile, limits: MiniLimits, ) -> Result<MiniClient, ServiceError>
Start one Session-free owner through the same reservation/table and stop barrier as persistent owners. Trusted Rust API only; daemon/wire Mini admission remains closed until its separate capability is complete.
Sourcepub fn mini_client(&self, id: AgentId) -> Result<MiniClient, ServiceError>
pub fn mini_client(&self, id: AgentId) -> Result<MiniClient, ServiceError>
Attach to this exact Mini incarnation; no latest-owner lookup occurs in the returned weak client, so an old client cannot retarget a later load.
Sourcepub fn ordinary_client(
&self,
id: AgentId,
) -> Result<OrdinaryClient, ServiceError>
pub fn ordinary_client( &self, id: AgentId, ) -> Result<OrdinaryClient, ServiceError>
Attach/detach only changes this weak observer, never native lifetime. This does not authorize arbitrary callers; the IPC authority layer must check the invocation’s scope before exposing it.
Sourcepub async fn admission(
&self,
id: AgentId,
request_id: &str,
) -> Result<Option<HostAdmissionStatus>, ServiceError>
pub async fn admission( &self, id: AgentId, request_id: &str, ) -> Result<Option<HostAdmissionStatus>, ServiceError>
Native admission/reconciliation query for one request. This is a read: it does not submit, replay or extend any admitted work.
Sourcepub async fn admissions(
&self,
id: AgentId,
) -> Result<Vec<HostAdmissionStatus>, ServiceError>
pub async fn admissions( &self, id: AgentId, ) -> Result<Vec<HostAdmissionStatus>, ServiceError>
Bounded native admission listing for crash reconciliation.
Sourcepub async fn cancel_ordinary_guarded(
&self,
id: AgentId,
guard: CatalogGuard,
ticket: RunId,
) -> Result<bool, ServiceError>
pub async fn cancel_ordinary_guarded( &self, id: AgentId, guard: CatalogGuard, ticket: RunId, ) -> Result<bool, ServiceError>
Trusted administrative signal only, not an authorization grant or a journal receipt. Shutdown fences the whole signal transaction. Native cancellation checks the owner-observed revision plus exact volatile ticket, not an authoritative catalog CAS; it cannot target a later run.
Sourcepub async fn cancel_submitted_ordinary_guarded(
&self,
id: AgentId,
guard: CatalogGuard,
submitted_request_id: RequestId,
) -> Result<bool, ServiceError>
pub async fn cancel_submitted_ordinary_guarded( &self, id: AgentId, guard: CatalogGuard, submitted_request_id: RequestId, ) -> Result<bool, ServiceError>
Stable-input counterpart of the volatile-ticket API. Only an active association in this owner lifetime can be signalled; history is never replayed/resumed. This signal alone is not a lifecycle journal receipt.
Sourcepub async fn close_ordinary_guarded(
&self,
id: AgentId,
guard: CatalogGuard,
) -> Result<(), ServiceError>
pub async fn close_ordinary_guarded( &self, id: AgentId, guard: CatalogGuard, ) -> Result<(), ServiceError>
Administrative close uses native preconditions before retirement. A definite pre-effect rejection restores the original registry phase; uncertainty/settlement failure keeps the owner and marks CloseFailed. This is not a durable request receipt; the journal coordinator is separate.
Sourcepub async fn close_ordinary(&self, id: AgentId) -> Result<(), ServiceError>
pub async fn close_ordinary(&self, id: AgentId) -> Result<(), ServiceError>
Explicit close can be retried after a failed shutdown. A dropped waiter cannot cancel settlement or release an unsettled owner/capacity slot.
Sourcepub async fn close_agent(&self, id: AgentId) -> Result<(), ServiceError>
pub async fn close_agent(&self, id: AgentId) -> Result<(), ServiceError>
Mode-independent close on the sole native owner table. Mini reaches Lost only after its prompt and actual DLL custody settle, never on cancellation.
Sourcepub async fn shutdown(&self) -> Result<(), ServiceError>
pub async fn shutdown(&self) -> Result<(), ServiceError>
Drain all loaded Agents concurrently, retaining failures. Catalog and singleton lock are released only when every native owner settled. This coordinator deliberately has no force-abort or lossy timeout shortcut.