Expand description
Runtime for applications built with the slave framework.
Generated applications depend on this crate for the pieces every app needs:
environment configuration ([env]), structured logging (logging), an
HTTP server with graceful shutdown (server) and, with the default
database feature, a SurrealDB connection and
SurrealQL migrations (database), and with the default auth
feature, passwordless sign-in (auth): one-time codes by email,
passkeys and server-side sessions. The testing feature adds a test
database.
Re-exports§
pub use surrealdb;
Modules§
- auth
- Passwordless sign-in: one-time codes by email, passkeys, and sessions.
- database
- The application’s SurrealDB database.
- env
- Reading configuration from the process environment and
.envfiles. - logging
- Structured logging via
tracing. - server
- HTTP server lifecycle.
Macros§
- transaction
- Runs a block in a transaction: committed when it evaluates to
Ok, cancelled when it evaluates toErr(?leaves the block, not the function). When the transaction conflicts with a concurrent one, the block runs again in a new transaction, up toTRANSACTION_ATTEMPTStimes.
Enums§
- Error
- Errors raised by the slave runtime.
Type Aliases§
- Result
- Shorthand for results returned by the slave runtime.