Skip to main content

NativeApp

Struct NativeApp 

Source
pub struct NativeApp { /* private fields */ }
Expand description

A started native App whose generated clients can invoke resolved bindings.

Implementations§

Source§

impl NativeApp

Source

pub fn ensure_binding<C: RequestCapability>( &self, caller_instance: &str, ) -> Result<(), RuntimeFailure>

Confirms that a generated client has one resolved binding before use.

Source

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.

Source

pub fn optional_handle<C: RequestCapability>( &self, caller_instance: &str, ) -> Option<NativeRequestHandle<C>>

Materializes an optional typed handle; an absent binding remains None.

Source

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.

Source

pub fn binding_count<C: RequestCapability>( &self, caller_instance: &str, ) -> usize

Returns the number of immutable provider endpoints bound to one requirement.

Source

pub fn is_ready(&self) -> bool

Returns whether every declared Module has completed activation.

Source

pub fn ready_gate(&self) -> AppReadyGate

Returns the App-wide readiness signal observed by Module tasks.

Source

pub fn is_accepting(&self) -> bool

Returns whether new externally triggered work may be admitted.

Source

pub fn admission(&self) -> AppAdmission

Returns the App-wide admission state.

Source

pub fn diagnostics(&self) -> RuntimeDiagnostics

Returns the opt-in Runtime Diagnostics port for this App.

Source

pub fn dependencies( &self, caller_instance: &str, ) -> Result<ModuleDependencies, RuntimeFailure>

Returns the exact resolved Capability dependencies for one Module Instance.

Runners use this host-facing view when they must preserve provider identity while transferring one binding across an Execution Lane. Ordinary Module code receives the same Interface through its lifecycle context.

Source

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.

Source

pub fn terminal_failure(&self) -> Option<RuntimeFailure>

Returns the terminal supervision failure, when a critical App path exhausted its budget.

Source

pub fn is_failed(&self) -> bool

Returns whether supervision has produced a terminal App failure.

Source

pub fn module_generation(&self, instance_key: &str) -> Option<u64>

Returns the current ready generation for one Module Instance, when it is available.

Source

pub fn report_module_failure( &self, instance_key: &str, ) -> Result<(), RuntimeFailure>

Reports a Module Instance failure and schedules its finite supervision policy.

Source

pub fn request_shutdown(&self)

Starts shutdown admission closure and cooperative cancellation.

Source

pub async fn shutdown(&self, timeout: Duration) -> ShutdownOutcome

Performs bounded graceful shutdown using one global deadline.

Source

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.

Source

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.

Source

pub fn invocation_context_after( &self, timeout: Duration, cancellation: CancellationToken, ) -> InvocationContext

Creates a request context whose deadline is relative to the Driver’s clock.

Source

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.

Source

pub fn stream_handle<C: StreamCapability>( &self, caller_instance: &str, ) -> Result<NativeStreamHandle<C>, RuntimeFailure>

Materializes one typed bidirectional stream handle from the resolved Plan.

Source

pub fn optional_stream_handle<C: StreamCapability>( &self, caller_instance: &str, ) -> Option<NativeStreamHandle<C>>

Materializes an optional typed bidirectional stream handle.

Source

pub fn stream_binding_count<C: StreamCapability>( &self, caller_instance: &str, ) -> usize

Returns the number of immutable stream endpoints bound to one requirement.

Source

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.

Source

pub fn optional_event_handle<C: EventCapability>( &self, caller_instance: &str, ) -> Option<NativeEventHandle<C>>

Materializes an optional typed Event handle.

Source

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.

Source

pub fn event_binding_count<C: EventCapability>( &self, caller_instance: &str, ) -> usize

Returns the number of immutable Event subscriber endpoints bound to a requirement.

Trait Implementations§

Source§

impl Clone for NativeApp

Source§

fn clone(&self) -> NativeApp

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 Debug for NativeApp

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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, <T as TryFrom<U>>::Error>

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.