pub struct NativeApp { /* private fields */ }Expand description
A started native App whose generated clients can invoke resolved bindings.
Implementations§
Source§impl NativeApp
impl NativeApp
Sourcepub fn ensure_binding<C: RequestCapability>(
&self,
caller_instance: &str,
) -> Result<(), RuntimeFailure>
pub fn ensure_binding<C: RequestCapability>( &self, caller_instance: &str, ) -> Result<(), RuntimeFailure>
Confirms that a generated client has one resolved binding before use.
Sourcepub fn handle<C: RequestCapability>(
&self,
caller_instance: &str,
) -> Result<NativeRequestHandle<C>, RuntimeFailure>
pub fn handle<C: RequestCapability>( &self, caller_instance: &str, ) -> Result<NativeRequestHandle<C>, RuntimeFailure>
Materializes one typed handle from the immutable binding selected by the Plan.
Sourcepub fn optional_handle<C: RequestCapability>(
&self,
caller_instance: &str,
) -> Option<NativeRequestHandle<C>>
pub fn optional_handle<C: RequestCapability>( &self, caller_instance: &str, ) -> Option<NativeRequestHandle<C>>
Materializes an optional typed handle; an absent binding remains None.
Sourcepub fn many_handle<C: RequestCapability>(
&self,
caller_instance: &str,
) -> Result<NativeRequestHandle<C>, RuntimeFailure>
pub fn many_handle<C: RequestCapability>( &self, caller_instance: &str, ) -> Result<NativeRequestHandle<C>, RuntimeFailure>
Materializes a typed handle whose endpoints may be empty for a many requirement.
Sourcepub fn binding_count<C: RequestCapability>(
&self,
caller_instance: &str,
) -> usize
pub fn binding_count<C: RequestCapability>( &self, caller_instance: &str, ) -> usize
Returns the number of immutable provider endpoints bound to one requirement.
Sourcepub fn ready_gate(&self) -> AppReadyGate
pub fn ready_gate(&self) -> AppReadyGate
Returns the App-wide readiness signal observed by Module tasks.
Sourcepub fn is_accepting(&self) -> bool
pub fn is_accepting(&self) -> bool
Returns whether new externally triggered work may be admitted.
Sourcepub fn admission(&self) -> AppAdmission
pub fn admission(&self) -> AppAdmission
Returns the App-wide admission state.
Sourcepub fn diagnostics(&self) -> RuntimeDiagnostics
pub fn diagnostics(&self) -> RuntimeDiagnostics
Returns the opt-in Runtime Diagnostics port for this App.
Sourcepub fn instance_queue_depths(&self) -> BTreeMap<String, usize>
pub fn instance_queue_depths(&self) -> BTreeMap<String, usize>
Returns current bounded request queue depths grouped by provider Instance.
This structural snapshot contains no request payloads and is intended for Runner-owned placement diagnostics.
Sourcepub fn terminal_failure(&self) -> Option<RuntimeFailure>
pub fn terminal_failure(&self) -> Option<RuntimeFailure>
Returns the terminal supervision failure, when a critical App path exhausted its budget.
Sourcepub fn is_failed(&self) -> bool
pub fn is_failed(&self) -> bool
Returns whether supervision has produced a terminal App failure.
Sourcepub fn module_generation(&self, instance_key: &str) -> Option<u64>
pub fn module_generation(&self, instance_key: &str) -> Option<u64>
Returns the current ready generation for one Module Instance, when it is available.
Sourcepub fn report_module_failure(
&self,
instance_key: &str,
) -> Result<(), RuntimeFailure>
pub fn report_module_failure( &self, instance_key: &str, ) -> Result<(), RuntimeFailure>
Reports a Module Instance failure and schedules its finite supervision policy.
Sourcepub fn request_shutdown(&self)
pub fn request_shutdown(&self)
Starts shutdown admission closure and cooperative cancellation.
Sourcepub async fn shutdown(&self, timeout: Duration) -> ShutdownOutcome
pub async fn shutdown(&self, timeout: Duration) -> ShutdownOutcome
Performs bounded graceful shutdown using one global deadline.
Sourcepub async fn invoke<C: RequestCapability>(
&self,
caller_instance: &str,
operation: &str,
request: C::Request,
) -> Result<Result<C::Response, C::DomainError>, RuntimeFailure>
pub async fn invoke<C: RequestCapability>( &self, caller_instance: &str, operation: &str, request: C::Request, ) -> Result<Result<C::Response, C::DomainError>, RuntimeFailure>
Invokes a generated request Operation through the caller’s resolved binding.
Sourcepub fn invocation_context(
&self,
deadline: Option<Duration>,
cancellation: CancellationToken,
) -> InvocationContext
pub fn invocation_context( &self, deadline: Option<Duration>, cancellation: CancellationToken, ) -> InvocationContext
Creates a request context with a fresh Kernel Request ID.
deadline is an absolute instant returned by the selected
[RuntimeDriver]’s monotonic clock.
Sourcepub fn invocation_context_after(
&self,
timeout: Duration,
cancellation: CancellationToken,
) -> InvocationContext
pub fn invocation_context_after( &self, timeout: Duration, cancellation: CancellationToken, ) -> InvocationContext
Creates a request context whose deadline is relative to the Driver’s clock.
Sourcepub async fn invoke_with_context<C: RequestCapability>(
&self,
caller_instance: &str,
operation: &str,
context: InvocationContext,
request: C::Request,
) -> Result<Result<C::Response, C::DomainError>, RuntimeFailure>
pub async fn invoke_with_context<C: RequestCapability>( &self, caller_instance: &str, operation: &str, context: InvocationContext, request: C::Request, ) -> Result<Result<C::Response, C::DomainError>, RuntimeFailure>
Invokes a request with an explicit propagated Invocation Context.
Sourcepub fn stream_handle<C: StreamCapability>(
&self,
caller_instance: &str,
) -> Result<NativeStreamHandle<C>, RuntimeFailure>
pub fn stream_handle<C: StreamCapability>( &self, caller_instance: &str, ) -> Result<NativeStreamHandle<C>, RuntimeFailure>
Materializes one typed bidirectional stream handle from the resolved Plan.
Sourcepub fn optional_stream_handle<C: StreamCapability>(
&self,
caller_instance: &str,
) -> Option<NativeStreamHandle<C>>
pub fn optional_stream_handle<C: StreamCapability>( &self, caller_instance: &str, ) -> Option<NativeStreamHandle<C>>
Materializes an optional typed bidirectional stream handle.
Sourcepub fn stream_binding_count<C: StreamCapability>(
&self,
caller_instance: &str,
) -> usize
pub fn stream_binding_count<C: StreamCapability>( &self, caller_instance: &str, ) -> usize
Returns the number of immutable stream endpoints bound to one requirement.
Sourcepub fn event_handle<C: EventCapability>(
&self,
caller_instance: &str,
) -> Result<NativeEventHandle<C>, RuntimeFailure>
pub fn event_handle<C: EventCapability>( &self, caller_instance: &str, ) -> Result<NativeEventHandle<C>, RuntimeFailure>
Materializes a typed Event handle and requires at least one subscriber.
Sourcepub fn optional_event_handle<C: EventCapability>(
&self,
caller_instance: &str,
) -> Option<NativeEventHandle<C>>
pub fn optional_event_handle<C: EventCapability>( &self, caller_instance: &str, ) -> Option<NativeEventHandle<C>>
Materializes an optional typed Event handle.
Sourcepub fn many_event_handle<C: EventCapability>(
&self,
caller_instance: &str,
) -> Result<NativeEventHandle<C>, RuntimeFailure>
pub fn many_event_handle<C: EventCapability>( &self, caller_instance: &str, ) -> Result<NativeEventHandle<C>, RuntimeFailure>
Materializes a typed Event handle whose endpoint set may be empty.
Sourcepub fn event_binding_count<C: EventCapability>(
&self,
caller_instance: &str,
) -> usize
pub fn event_binding_count<C: EventCapability>( &self, caller_instance: &str, ) -> usize
Returns the number of immutable Event subscriber endpoints bound to a requirement.