Skip to main content

StableApplicationClient

Struct StableApplicationClient 

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

Application-only client facade.

This type deliberately has no accessor for its kernel client. Stable application code can execute name-addressed commands and exact named queries, but cannot construct raw entity/index requests through this surface.

Implementations§

Source§

impl StableApplicationClient

Source

pub async fn connect_verified_tls( config: &TlsClientConfig, ) -> Result<Self, ClientError>

Connects the application-only facade through mandatory explicit TLS trust and exact peer-name verification.

Source

pub async fn connect_uri(endpoint: String) -> Result<Self, ClientError>

Connects the application facade from one bounded URI without exposing the transport package to application code.

Source

pub async fn connect(endpoint: Endpoint) -> Result<Self, ClientError>

Connects the application facade over one reusable HTTP/2 channel.

Source

pub fn from_channel(channel: Channel) -> Self

Constructs the application facade over an existing channel.

Source

pub fn with_standby_clients( self, standby: Vec<Self>, ) -> Result<Self, ApplicationClientError>

Attaches up to 4 standby channels for automatic contract-verified failover when the primary is fenced or unreachable.

Source

pub fn with_read_replica_clients( self, replicas: Vec<Self>, ) -> Result<Self, ApplicationClientError>

Attaches up to 4 follower read-replica channels for eligible read queries with automatic primary fallback.

Source

pub fn standby_client_count(&self) -> usize

Returns the number of remaining standby channels configured on this facade.

Source

pub fn read_replica_client_count(&self) -> usize

Returns the number of read-replica channels configured on this facade.

Source

pub async fn open_bounded_session( &mut self, identity: ApplicationSessionIdentity, metadata: &CallMetadata, ) -> Result<(), ApplicationClientError>

Opens the optional bounded multiplexed application transport against one exact generated application identity. Unary transport remains the default until this explicit operation succeeds.

Source

pub const fn bounded_session_enabled(&self) -> bool

Reports whether this facade explicitly selected the bounded session.

Source

pub fn close_bounded_session(&mut self)

Explicitly closes the optional bounded session and returns this facade to unary transport. In-flight operations are released under the same uncertainty rules as stream loss.

Source

pub async fn verify_active_contract( &mut self, database: &str, lineage: &str, version: u64, bundle_hash: [u8; 32], metadata: &CallMetadata, ) -> Result<(), ApplicationClientError>

Proves that the authenticated remote database currently exposes the exact contract identity compiled into the application lock.

Source

pub async fn preflight_application_features( &mut self, contract: ApplicationContract, metadata: &CallMetadata, ) -> Result<ApplicationCatalogPreflight, ApplicationClientError>

Reads and validates the symbolic feature catalog for one exact contract.

This application-only view deliberately omits catalog symbols, numeric identities, raw IR, and capability details. An unavailable feature is explicit and never authorizes a client-side fallback.

Source

pub async fn inspect_vector_state( &mut self, request: VectorStateInspection, metadata: &CallMetadata, ) -> Result<VectorStateInspectionResult, ApplicationClientError>

Inspects one compiler-declared production vector field through the symbolic, policy-filtered application operation.

Source

pub async fn execute_named_query( &mut self, query: NamedQuery, metadata: &CallMetadata, ) -> Result<NamedQueryResult, ApplicationClientError>

Executes one exact named module query.

Source

pub async fn execute_generated_query<Q: GeneratedQuery>( &mut self, query: Q, options: QueryOptions, metadata: &CallMetadata, ) -> Result<TypedQueryResult<Q::Output>, ApplicationClientError>

Executes and decodes one generated exact named-query shape.

Source

pub async fn execute_command( &mut self, command: ApplicationCommand, attempts: AttemptBudget, metadata: &CallMetadata, ) -> Result<ApplicationCommandResult, ApplicationClientError>

Executes one exact symbolic command with bounded uncertainty recovery.

Source

pub async fn execute_generated_command<C: GeneratedCommand>( &mut self, command: &C, attempts: AttemptBudget, metadata: &CallMetadata, ) -> Result<TypedCommandResult<C::Outcome>, GeneratedExecutionError>

Executes and decodes one generated command, then performs one exact same-key outcome lookup if transport uncertainty remains.

Source

pub async fn execute_generated_command_batch<C>( &self, commands: Vec<C>, options: GeneratedBatchOptions, attempts: AttemptBudget, metadata: &CallMetadata, ) -> Result<GeneratedBatchResult<C::Outcome>, GeneratedBatchError>

Executes a bounded collection of ordinary generated commands with backpressure and independently ordered per-item results.

Source

pub async fn execute_generated_command_batch_with_progress<C, F>( &self, commands: Vec<C>, options: GeneratedBatchOptions, attempts: AttemptBudget, metadata: &CallMetadata, report_progress: F, ) -> Result<GeneratedBatchResult<C::Outcome>, GeneratedBatchError>

Executes a bounded generated-command batch and reports completion plus the largest contiguous, safely resumable input checkpoint.

Source§

impl StableApplicationClient

Source

pub async fn execute_projected_query( &mut self, query: ProjectedQuery, metadata: &CallMetadata, ) -> Result<ProjectedQueryOutcome, ApplicationClientError>

Executes one projected columnar query through the application facade.

Source§

impl StableApplicationClient

Source

pub async fn consume_generated_events<G: GeneratedEventConsumer>( &mut self, generated: G, options: EventConsumerOptions, metadata: &CallMetadata, ) -> Result<TypedEventBatch<G::Event>, ApplicationClientError>

Pulls and decodes one generated typed event batch.

Source

pub async fn consume_generated_contextual<G: GeneratedEventConsumer>( &mut self, generated: G, maximum_wait_nanos: u64, metadata: &CallMetadata, ) -> Result<TypedContextualBatch<G::Event>, ApplicationClientError>

Pulls and decodes one generated contextual work item.

Source

pub async fn execute_generated_contextual_reaction<C: GeneratedCommand>( &mut self, consumer: &ApplicationEventConsumer, reaction: &ApplicationContextualReaction, command: &C, metadata: &CallMetadata, ) -> Result<TypedCommandResult<C::Outcome>, GeneratedExecutionError>

Executes one generated command through an available contextual reaction.

Source

pub async fn watch_generated_query<G: GeneratedLiveQuery>( &mut self, generated: G, cursor: Option<LiveQueryCursor>, metadata: &CallMetadata, ) -> Result<TypedLiveQueryStream<G>, ApplicationClientError>

Opens and decodes one generated exact live query.

Source

pub async fn consume_event_stream( &mut self, consumer: &ApplicationEventConsumer, options: EventConsumerOptions, metadata: &CallMetadata, ) -> Result<ApplicationEventBatch, ApplicationClientError>

Pulls one bounded authorized batch from an exact generated stream.

Source

pub async fn consume_event_stream_after( &mut self, consumer: &ApplicationEventConsumer, options: EventConsumerOptions, progress_cursor: Option<ApplicationEventProgressCursor>, metadata: &CallMetadata, ) -> Result<ApplicationEventBatch, ApplicationClientError>

Continues one protected consumer from an opaque RiffDB cursor.

Source

pub async fn consume_contextual_subscription( &mut self, consumer: &ApplicationEventConsumer, maximum_wait_nanos: u64, metadata: &CallMetadata, ) -> Result<ApplicationContextualBatch, ApplicationClientError>

Pulls one contextual event with fresh same-snapshot hydrations.

Source

pub async fn consume_contextual_subscription_after( &mut self, consumer: &ApplicationEventConsumer, maximum_wait_nanos: u64, progress_cursor: Option<ApplicationEventProgressCursor>, metadata: &CallMetadata, ) -> Result<ApplicationContextualBatch, ApplicationClientError>

Continues one protected contextual subscription from an opaque cursor.

Source

pub async fn acknowledge_contextual_item( &mut self, consumer: &ApplicationEventConsumer, item: &ApplicationContextualWorkItem, metadata: &CallMetadata, ) -> Result<ApplicationEventMutationResult, ApplicationClientError>

Acknowledges one exact contextual lease after fresh authorization.

Source

pub async fn acknowledge_contextual_lease( &mut self, consumer: &ApplicationEventConsumer, evidence: &ApplicationEventLeaseEvidence, metadata: &CallMetadata, ) -> Result<ApplicationEventMutationResult, ApplicationClientError>

Acknowledges exact contextual lease evidence after fresh authorization.

Source

pub async fn negative_acknowledge_contextual_item( &mut self, consumer: &ApplicationEventConsumer, item: &ApplicationContextualWorkItem, retry_delay_nanos: u64, metadata: &CallMetadata, ) -> Result<ApplicationEventMutationResult, ApplicationClientError>

Negatively acknowledges one exact contextual lease with bounded delay.

Source

pub async fn negative_acknowledge_contextual_lease( &mut self, consumer: &ApplicationEventConsumer, evidence: &ApplicationEventLeaseEvidence, retry_delay_nanos: u64, metadata: &CallMetadata, ) -> Result<ApplicationEventMutationResult, ApplicationClientError>

Releases exact contextual lease evidence with a bounded retry delay.

Source

pub async fn contextual_subscription_status( &mut self, consumer: &ApplicationEventConsumer, metadata: &CallMetadata, ) -> Result<Option<ApplicationEventConsumerPublicStatus>, ApplicationClientError>

Reads one contextual consumer status under contextual consume authority.

Source

pub async fn execute_contextual_reaction( &mut self, consumer: &ApplicationEventConsumer, reaction: &ApplicationContextualReaction, command: ApplicationCommand, metadata: &CallMetadata, ) -> Result<ApplicationCommandResult, ApplicationClientError>

Executes one declared reaction through the ordinary typed command envelope.

Source

pub async fn stream_event_consumer( &mut self, consumer: &ApplicationEventConsumer, options: EventConsumerOptions, metadata: &CallMetadata, ) -> Result<ApplicationEventResponseStream, ApplicationClientError>

Opens the checked server stream for the same consumer operation.

Source

pub async fn acknowledge_event( &mut self, consumer: &ApplicationEventConsumer, delivery: &ApplicationEventDelivery, metadata: &CallMetadata, ) -> Result<ApplicationEventMutationResult, ApplicationClientError>

Acknowledges one exact live lease under the same reauthorized identity.

Source

pub async fn acknowledge_event_lease( &mut self, consumer: &ApplicationEventConsumer, evidence: &ApplicationEventLeaseEvidence, metadata: &CallMetadata, ) -> Result<ApplicationEventMutationResult, ApplicationClientError>

Acknowledges one exact checked lease identity.

Source

pub async fn negative_acknowledge_event( &mut self, consumer: &ApplicationEventConsumer, delivery: &ApplicationEventDelivery, retry_delay_nanos: u64, metadata: &CallMetadata, ) -> Result<ApplicationEventMutationResult, ApplicationClientError>

Negatively acknowledges one exact live lease with a bounded delay.

Source

pub async fn negative_acknowledge_event_lease( &mut self, consumer: &ApplicationEventConsumer, evidence: &ApplicationEventLeaseEvidence, retry_delay_nanos: u64, metadata: &CallMetadata, ) -> Result<ApplicationEventMutationResult, ApplicationClientError>

Negatively acknowledges one exact checked lease identity.

Source

pub async fn seek_event_consumer( &mut self, consumer: &ApplicationEventConsumer, checkpoint: ApplicationEventCheckpoint, metadata: &CallMetadata, ) -> Result<ApplicationEventMutationResult, ApplicationClientError>

Moves one exact consumer checkpoint after server-side membership proof.

Source

pub async fn seek_protected_event_consumer( &mut self, consumer: &ApplicationEventConsumer, cursor: ApplicationEventProgressCursor, metadata: &CallMetadata, ) -> Result<ApplicationEventMutationResult, ApplicationClientError>

Moves one protected consumer to an opaque position previously issued under the same current principal, role, capability, and stream identity.

Source

pub async fn event_consumer_status( &mut self, consumer: &ApplicationEventConsumer, metadata: &CallMetadata, ) -> Result<Option<ApplicationEventConsumerPublicStatus>, ApplicationClientError>

Reads bounded status under consume authority.

Source

pub async fn watch_named_query( &mut self, operation: &ApplicationReactiveOperation, cursor: Option<LiveQueryCursor>, metadata: &CallMetadata, ) -> Result<ApplicationLiveQueryStream, ApplicationClientError>

Opens one exact generated named-query watch with optional cursor evidence.

Trait Implementations§

Source§

impl Clone for StableApplicationClient

Source§

fn clone(&self) -> StableApplicationClient

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

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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.

§

impl<T> IntoRequest<T> for T

§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<L> LayerExt<L> for L

§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in [Layered].
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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 = Infallible

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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more