Expand description
The service-provider interface between the SurrealDB Rust SDK and the engines it drives.
An engine owns a datastore or a connection to one, and serves
SurrealEngine to the SDK. Some run as a task the SDK hands a Route
per request, answering on the route’s response channel; session lifetime
travels alongside on a separate SessionId channel either way. This crate
holds exactly the types that cross that boundary, so an engine can live in
its own crate without the SDK depending on it, or on anything it in turn
depends on.
§Stability
This is an internal interface between crates released together. It carries
no stability guarantee and may change in any release, including a patch
release. Depend on it only if you implement an engine; application code
should use the surrealdb crate.
Re-exports§
pub use session::Established;pub use session::SessionEntry;pub use session::SessionRegistry;
Modules§
- session
- The registry an engine keeps its sessions in.
Structs§
- DbExport
Config - Engine
Context - Which session, and which explicit transaction, a request applies to.
- MlExport
Config - Which machine learning model to export, by name and version.
- Request
Data - A request travelling from the SDK to an engine, tagged with the session it belongs to.
- Route
- A request paired with the channel its response must be sent on.
- Route
Channel Engine - A
SurrealEnginethat drives an engine which consumesRoutes.
Enums§
- Command
- The operations an engine can be asked to perform.
- Session
Error - Why a route could not be matched to a session.
- Session
Id - A session-lifetime event. Engines keep per-session state (the authenticated session, its variables, its live queries), and these events tell them when to create, copy and discard it.
Constants§
- QUERY_
STREAM_ BUFFER - The channel depth a consumer should give a streaming execution.
Traits§
- Surreal
Engine - The interface every SurrealDB engine implements, and the only thing the Rust SDK calls to reach a database.
Functions§
- session_
error_ to_ error - Convert a session error into the error type the SDK surfaces to callers.
- single_
result - Flattens the results of an operation that runs a single statement into the one value it produced.
Type Aliases§
- BoxFuture
- A future boxed for storage behind a trait object, as
SurrealEngine’s methods require. - Engine
Future - A boxed engine result.