Skip to main content

riffdb_client_rust/
lib.rs

1#![forbid(unsafe_code)]
2
3//! Typed public gRPC client for RiffDB.
4//!
5//! This crate contains transport ergonomics only. Contract validation,
6//! authorization, idempotency, command execution, and durable recovery remain
7//! server-owned semantics.
8
9mod application;
10mod capability;
11mod client;
12mod command;
13mod credential_file;
14mod export;
15mod ids;
16mod installation;
17mod maintenance;
18mod metadata;
19mod projected;
20mod reactive;
21mod reimport;
22mod saga;
23mod session;
24mod status;
25mod tls;
26
27/// Boundaries implemented by contract-generated ergonomic modules.
28pub mod generated;
29
30/// Exact symbolic application wire types used by the typed transport client.
31pub use riffdb_proto::app::v1 as app_v1;
32/// Exact public wire types used by the typed transport client.
33///
34/// Re-exporting the generated package lets public-API consumers construct
35/// requests without taking a second direct dependency on the Proto owner.
36pub use riffdb_proto::v1;
37#[doc(hidden)]
38pub use riffdb_proto::{canonical_value_from_proto, canonical_value_to_proto};
39#[doc(hidden)]
40pub use riffdb_types::{CanonicalValue, decode_canonical_value};
41
42pub use application::{
43    ApplicationCardinality, ApplicationCatalogFeature, ApplicationCatalogFeatureState,
44    ApplicationCatalogFeatureView, ApplicationCatalogPreflight, ApplicationClientError,
45    ApplicationCommand, ApplicationCommandResult, ApplicationContract, ApplicationRecord,
46    ApplicationResultField, ApplicationUuid, ApplicationValue, GeneratedBatchError,
47    GeneratedBatchItem, GeneratedBatchOptions, GeneratedBatchProgress, GeneratedBatchResult,
48    GeneratedQueryPageStream, IdempotentTransportBatchError, MAX_GENERATED_BATCH_CONCURRENCY,
49    MAX_STREAMED_QUERY_PAGES, NamedQuery, NamedQueryPageStream, NamedQueryResult, QueryOptions,
50    QueryResponseIdentity, StableApplicationClient, TypedCommandResult, TypedQueryResult,
51    VectorInspectionPage, VectorModelVersionItem, VectorModelVersionSummary, VectorStalenessItem,
52    VectorStalenessSummary, VectorStateInspection, VectorStateInspectionKind,
53    VectorStateInspectionResult,
54};
55#[doc(hidden)]
56pub use application::{raise_query_result, raise_value};
57pub use capability::{
58    BootstrapCapabilityCreateTemplate, CapabilityCreateTemplateError,
59    NormalCapabilityCreateTemplate,
60};
61pub use client::{
62    CommitNotificationStream, EventConsumerResponseStream, GeneratedExecution,
63    GeneratedExecutionError, LiveQueryUpdateStream, RiffDbClient,
64};
65pub use command::{AttemptBudget, CommandShapeError, IdempotentCommand};
66pub use credential_file::{
67    BearerCredentialFileCause, BearerCredentialFileError, BearerCredentialFileFailure,
68    load_protected_bearer_credential, load_protected_bearer_credential_diagnosed,
69};
70pub use export::StartApplicationExport;
71pub use ids::{
72    IdentifierGenerationError, SystemIdSource, generate_agent_session_id,
73    generate_application_export_operation_id, generate_application_installation_campaign_id,
74    generate_capability_id, generate_contract_migration_operation_id,
75    generate_offline_maintenance_operation_id, generate_request_id,
76};
77pub use installation::StartApplicationInstallation;
78pub use maintenance::{
79    ApplyContractMigration, CheckContractMigration, ContractMigrationSubmissionError,
80    CreateOfflineBackup, RestoreArchivedBackup, RestoreOfflineBackup, RetireOfflineBackup,
81    StartOfflineStorageScrub,
82};
83pub use metadata::{
84    BearerCredential, BootstrapCallMetadata, BootstrapCredential, CallMetadata, MetadataError,
85    TraceParent,
86};
87pub use projected::{
88    ProjectedAggregate, ProjectedAggregateGroup, ProjectedAggregateValue, ProjectedDegradedReason,
89    ProjectedOrder, ProjectedPredicate, ProjectedQuery, ProjectedQueryOutcome, ProjectedReadyRow,
90    ProjectedRebuildingReason, ProjectedResponseEncoding, ProjectedSortDirection,
91    raise_projected_response_for_query,
92};
93pub use reactive::{
94    ApplicationContextualBatch, ApplicationContextualHydration, ApplicationContextualReaction,
95    ApplicationContextualWorkItem, ApplicationEvent, ApplicationEventBatch,
96    ApplicationEventCheckpoint, ApplicationEventConsumer, ApplicationEventConsumerPublicStatus,
97    ApplicationEventConsumerStatus, ApplicationEventDelivery, ApplicationEventId,
98    ApplicationEventLeaseEvidence, ApplicationEventMutationResult, ApplicationEventProgressCursor,
99    ApplicationEventPullDisposition, ApplicationEventResponseStream, ApplicationLiveQueryStream,
100    ApplicationLiveQueryUpdate, ApplicationProtectedEventConsumerStatus,
101    ApplicationReactiveOperation, EventConsumerOptions, LiveQueryCheckpoint, LiveQueryCursor,
102    LiveQueryPatch, LiveQueryPatchOperation, LiveQueryTerminal, TypedContextualBatch,
103    TypedContextualWorkItem, TypedEventBatch, TypedEventDelivery, TypedLiveQueryReset,
104    TypedLiveQuerySnapshot, TypedLiveQueryStream,
105};
106pub use reimport::StartApplicationReimport;
107/// Freshness policy and commit token types used by projected queries.
108pub use riffdb_types::{CanonicalVector, CommitToken, FreshnessPolicy, ProjectionFrontier};
109pub use saga::{
110    ClientCommittedSagaStep, ClientSagaDisposition, ClientSagaInstanceView, ClientSagaStatus,
111    ClientStartSagaResult, decode_saga_command_result,
112};
113pub use session::{
114    APPLICATION_SESSION_PROTOCOL_V1, ApplicationSessionConfigurationError,
115    ApplicationSessionIdentity, MAX_APPLICATION_SESSION_IN_FLIGHT,
116};
117pub use status::{
118    ClientError, DetailsFreeStatus, OutcomeUnknown, ProtocolFailure, ProtocolFailureKind,
119};
120pub use tls::{TlsClientFailure, TlsTrustReloadStatus, VerifiedTlsConnector};
121
122pub use riffdb_errors::{
123    ApplicationError, ApplicationErrorCategory, ApplicationErrorCode, ApplicationErrorContext,
124    ApplicationFixCode, ApplicationOperation, ApplicationRecoveryAction, ApplicationSourceSpan,
125    AuthorizationDiagnosticCode, ErrorClass, PublicError, PublicErrorDetails, PublicErrorKind,
126    RecoveryAction, ValidationCode, ValidationIssue, ValidationIssues, ValidationPath,
127    ValidationPathSegment,
128};
129pub use riffdb_types::{
130    ApplicationExportOperationId, ApplicationExportSelectionV1, ApplicationInstallationCampaignId,
131    ArchiveNameV1, ArchiveRestoreStopV1, BackupNameV1, BackupNameV1Error,
132    CapabilityApplicationExportScopeV1, CapabilityApplicationReimportScopeV1, CommitSequence,
133    ContractMigrationOperationId, DEFAULT_DATABASE_ALIAS, DatabaseAlias, MigrationBundleHash,
134    OfflineMaintenanceOperationId, OfflineMaintenanceReplacementConfirmation, RequestId, TenantId,
135};