Skip to main content

Crate type_bridge

Crate type_bridge 

Source
Expand description

Public Rust client library for TypeBridge.

Provides top-level Database, ConnectionOptions, SchemaPackage, and owner-branded schema/model primitives. plan builds typed query-plan/v3 programs and staged runs them in staged transactions.

Re-exports§

pub use error::Error;
pub use error::ErrorCategory;
pub use error::ErrorDetail;
pub use error::ErrorDiagnostic;
pub use error::ErrorPathSegment;
pub use error::ModelValidationPhase;
pub use error::QueryDiagnosticCategory;
pub use error::QueryDiagnosticPathKind;
pub use error::Result;
pub use hooks::CrudOperation;
pub use hooks::HookContext;
pub use hooks::HookError;
pub use hooks::HookFuture;
pub use hooks::LifecycleHook;
pub use hooks::ModelKind;
pub use hooks::PreHookResult;
pub use migration::MigrationApprovalBuilder;
pub use migration::MigrationApprovalSet;
pub use migration::MigrationCatalog;
pub use migration::MigrationHistoryEntry;
pub use migration::MigrationPlan;
pub use migration::MigrationPreview;
pub use migration::MigrationPreviewEntry;
pub use query::Binding;
pub use query::BoundField;
pub use query::BoundRole;
pub use query::Collected;
pub use query::Exact;
pub use query::FieldGroupedQuery;
pub use query::GroupedQuery;
pub use query::NamedSelection;
pub use query::Order;
pub use query::OrderedOperand;
pub use query::Page;
pub use query::PageOptions;
pub use query::Predicate;
pub use query::Query;
pub use query::QueryOperand;
pub use query::QuerySession;
pub use query::RowsOptions;
pub use query::Selectable;
pub use query::SelectedShape;
pub use query::SelectionMode;
pub use query::SingularSelectedShape;
pub use query::Subtypes;
pub use schema::Schema;
pub use schema::SchemaPackage;
pub use schema::Unbound;
pub use session::ConnectionOptions;
pub use session::Database;
pub use session::DatabaseCreateOutcome;
pub use session::DatabaseDeleteOutcome;
pub use session::ManagedDatabaseDeleteOutcome;
pub use session::ManagedDatabaseDeletionPlan;
pub use session::ManagedDatabasePairState;

Modules§

__codegen
Generated-code SPI for TypeBridge.
aggregate
Typed reduction terms and tuple decoding for the query facade (Flight 3, F3-04b-3).
error
Error handling for the public TypeBridge client.
failure
Value-only provider failure vocabulary used by Error::failure. Value-only typed provider failures. Value-only provider failure vocabulary; classification belongs to the runtime.
hooks
Generated-model CRUD lifecycle hooks.
migration
Generated-package-owned immutable migration catalog inspection.
model
Model traits and owner-branded tokens for generated TypeBridge models.
plan
Typed query-plan/v3 programs built from generated model tokens.
schema
Schema package markers and type-branded installation handshake.
session
Database session handles and connection options.
staged
Staged transactions: Database::transaction and ProxyDatabase::transaction.
value
Client-owned canonical query literals (Flight 3, F3-02).

Structs§

AnswerCancellation
Cloneable cooperative cancellation signal checked between provider items and used to wake in-flight provider awaits.
Binding
One schema/model-branded Copy binding token allocated by a QuerySession. Copying preserves the binding identity; only a fresh session binding call creates a new occurrence.
BoundField
One generated field resolved against one session binding occurrence.
BoundRole
One generated relation role resolved against one relation binding occurrence.
CanonicalCodecLimits
Tighten-only structural and byte ceilings for canonical codec work.
CanonicalCodecOptions
One owned cancellation/deadline/limit policy captured for a codec invocation.
Collected
One typed collection selection used inside a distinct-root page shape.
DirectConnectionPolicy
Immutable generated-package direct connection policy.
EntityManager
Schema-bound, model-branded manager for exact entity operations. Exact reads and writes exclude subtypes; methods return client input/schema-validation, database/transaction/close, or hydration/model-validation errors as applicable.
EntitySubtypeManager
Read-only, schema/model-branded manager for an inclusive generated subtype association. Results are the generated associated leaf or closed family type; no writes are exposed. Reads and counts can return input/schema-validation, database/transaction/close, or hydration/model-validation errors.
Exact
Exact-match selection: results materialize as the bound concrete model.
FieldGroupedQuery
One query lineage grouped by a generated owned field value for aggregation.
GroupedQuery
One query lineage grouped by a second attached binding for aggregation.
MigrationBackfillObservation
Bounded terminal observation for one canonical backfill operation.
MigrationCancellation
Cloneable, wakeable cancellation authority for migration operations.
MigrationExecutionControl
Immutable controls shared by apply and rollback execution.
MigrationExecutionReport
Bounded owned projection of one terminal apply or rollback outcome.
MigrationExecutionResourceLimits
Tighten-only bounded resources for one migration execution invocation.
MigrationVerifyReport
The complete read-only verification report.
NamedSelection
A declaration-ordered named selected shape produced by SelectedRow.
Order
One stable public ordering term over a bound field.
Page
One immutable owned distinct-root page.
PageOptions
Bounded options for one ordered distinct-root page.
Predicate
One schema-branded, composable query predicate.
ProjectedEntityFilter
Immutable canonical filter for one exact generated entity model.
ProjectedRelationFilter
Immutable canonical filter for one exact generated relation model.
ProxyConnectionPolicy
Configuration of a proxy connection: where requests go, the answer-limit ceiling every session inherits, and optionally a pinned advertisement.
ProxyDatabase
A proxy connection branded by schema S. Each generated query terminal is one exchange with the server; a staged ProxyDatabase::transaction sends its whole stack as one signed query-remote/v3 exchange at commit.
ProxyEndpoint
Where a proxy connection sends its requests: the server’s base URL, its TLS policy, and request headers such as Authorization.
Query
One persistent, reusable singular-shape query lineage.
QueryExecutionDeadline
One absolute monotonic deadline shared by every stage of one query terminal.
QueryExecutionLimitOutOfRange
One answer-policy value above its supported maximum.
QueryExecutionResourceLimits
The answer policy of one query terminal, the same on every transport.
QueryLimits
The complete set of ceilings applied to one query session’s plans.
QuerySession
One isolated owner-branded query authoring session.
ReadEntityManager
Borrowed read-only manager for one exact generated entity model.
ReadRelationManager
Borrowed read-only manager for one exact generated relation model.
ReadTransaction
One client-owned reusable read transaction over a schema-bound database.
RelationManager
Schema-bound, model-branded manager for exact relation operations. Exact reads and writes exclude subtypes; methods return client input/schema-validation, database/transaction/close, or hydration/model-validation errors as applicable.
RelationSubtypeManager
Read-only, schema/model-branded manager for an inclusive generated subtype association. Results are the generated associated leaf or closed family type; no writes are exposed. Reads and counts can return input/schema-validation, database/transaction/close, or hydration/model-validation errors.
RemoteQueryLimitsDeprecated
The 2.2 answer budget: QueryExecutionResourceLimits built from the 2.2 constructor arguments, with the proxy-default timeout and statements.
RowsOptions
Bounded options for one ordered row fetch.
Subtypes
Subtype-inclusive selection: results materialize as the generated leaf or closed family associated with the bound root.
TlsPolicy
Closed TLS policy for one generated-package direct or proxy connection.
TransactionEntityManager
Schema-bound, model-branded exact entity manager borrowing one open client write transaction. Operations reuse the shared open context and never commit, roll back, or close it; errors are returned with the transaction left open for the caller to decide.
TransactionRelationManager
Schema-bound, model-branded exact relation manager borrowing one open client write transaction. Operations reuse the shared open context and never commit, roll back, or close it; errors are returned with the transaction left open for the caller to decide.
WriteTransaction
One client-owned open write transaction over a schema-bound database.

Enums§

AnswerTransport
The transport an answer policy runs on, which decides its defaults.
Connection
A schema-bound connection opened by crate::SchemaPackage::connect.
ConnectionPolicy
Where a connection’s queries run.
MigrationDriftFinding
One verified drift finding.
MigrationExecutionDirection
Direction of one bounded public migration execution report.
MigrationExecutionReportPosition
Stable position vocabulary shared by forward and rollback reports.
MigrationExecutionStatus
Terminal status of one bounded public migration execution report.
ProjectedManagerComparison
One closed scalar comparison admitted by an exact generated-manager filter.
QueryExecutionLimitsError
Why a set of named answer-policy values was refused.
QueryLimitsError
Why a QueryLimits value was refused.
RemoteConnectionOptionsDeprecated
The 2.2 constructors of ProxyConnectionPolicy. Both return a ProxyConnectionPolicy; the 2.2 type name itself is not kept, since ProxyConnectionPolicy::new now takes an endpoint.

Constants§

DEFAULT_DIRECT_QUERY_ATTRIBUTE_VALUES
Direct-session default hydrated/projected attribute-value count.
DEFAULT_DIRECT_QUERY_BYTES
Direct-session default provider, reply, and projected payload bytes.
DEFAULT_DIRECT_QUERY_COLLECTION_MEMBERS
Direct-session default collection members, including reduction cells.
DEFAULT_DIRECT_QUERY_GRAPH_NODES
Direct-session default hydrated/projected graph-node count.
DEFAULT_DIRECT_QUERY_ITEMS
Direct-session default provider/result item count.
DEFAULT_DIRECT_QUERY_ROLE_PLAYERS
Direct-session default relation-role-player references.
DEFAULT_DIRECT_QUERY_STATEMENTS
Direct-session default provider statements per terminal.
DEFAULT_DIRECT_QUERY_TIMEOUT_MILLISECONDS
Direct-session default execution duration in milliseconds.
DEFAULT_PROXY_QUERY_ATTRIBUTE_VALUES
Proxy-connection default hydrated/projected attribute-value count.
DEFAULT_PROXY_QUERY_BYTES
Proxy-connection default provider, reply, and projected payload bytes.
DEFAULT_PROXY_QUERY_COLLECTION_MEMBERS
Proxy-connection default collection members, including reduction cells.
DEFAULT_PROXY_QUERY_GRAPH_NODES
Proxy-connection default hydrated/projected graph-node count.
DEFAULT_PROXY_QUERY_ITEMS
Proxy-connection default provider/result item count.
DEFAULT_PROXY_QUERY_ROLE_PLAYERS
Proxy-connection default relation-role-player references.
DEFAULT_PROXY_QUERY_STATEMENTS
Proxy-connection default provider statements per terminal.
DEFAULT_PROXY_QUERY_TIMEOUT_MILLISECONDS
Proxy-connection default execution duration in milliseconds.
MAX_MIGRATION_BACKFILL_OBSERVATIONS
Shared maximum number of retained terminal backfill observations.
MAX_MIGRATION_EXECUTION_GROUPS
Shared maximum number of migration transaction groups in one invocation.
MAX_QUERY_ATTRIBUTE_VALUESDeprecated
The 2.2 name of DEFAULT_PROXY_QUERY_ATTRIBUTE_VALUES, with the same value.
MAX_QUERY_BYTESDeprecated
The 2.2 name of DEFAULT_PROXY_QUERY_BYTES, with the same value.
MAX_QUERY_COLLECTION_MEMBERSDeprecated
The 2.2 name of DEFAULT_PROXY_QUERY_COLLECTION_MEMBERS, with the same value.
MAX_QUERY_GRAPH_NODESDeprecated
The 2.2 name of DEFAULT_PROXY_QUERY_GRAPH_NODES, with the same value.
MAX_QUERY_ITEMSDeprecated
The 2.2 name of DEFAULT_PROXY_QUERY_ITEMS, with the same value.
MAX_QUERY_ROLE_PLAYERSDeprecated
The 2.2 name of DEFAULT_PROXY_QUERY_ROLE_PLAYERS, with the same value.
MAX_QUERY_STATEMENTS
Most provider statements a terminal can need. No terminal issues more, so a larger value would be accepted and ignored.
MAX_QUERY_TIMEOUT_MILLISECONDS
Longest execution duration a policy may ask for, in milliseconds.

Traits§

OrderedOperand
Sealed marker for canonically ordered query operands.
ProxyExchange
A caller-owned exchange with a TypeBridge server, for hosts that route or authenticate requests themselves. ProxyConnectionPolicy::new uses the built-in HTTP transport instead.
QueryOperand
Sealed conversion from client literals and generated value wrappers into canonical query operands.
RemoteQueryTransportDeprecated
The 2.2 name of ProxyExchange. Every implementation is a ProxyExchange.
Selectable
Sealed resolution from one selected binding to its typed query output.
SelectedShape
Sealed typed selected-output shape accepted by the one query facade.
SelectionMode
Sealed marker for a binding’s exact-versus-subtypes selection behavior.
SingularSelectedShape
Sealed marker for a selected shape containing singular slots only.

Type Aliases§

DirectTlsDeprecated
The 2.2 name of TlsPolicy.
RemoteDatabaseDeprecated
The 2.2 name of ProxyDatabase.

Derive Macros§

SelectedRow
Derive a declaration-ordered named selection constructor for the public generated Rust query facade.