surrealdb_core/ctx/
mod.rs

1//! This module defines and handles the `context` for the SurrealDB database.
2//! ## Concept
3//! The context is shared through the code. To understand the context of `context` we must appreciate that
4//! there are different layers to the SurrealDB database. Whilst at this point in time there is no definition
5//! of all the layers in code, we can illustrate the layers with the following lifecycle of a database request:
6//! - we start with an SQL statement
7//! - the SQL statement is then parsed into an operation
8//! - we then go down to the key value store . . .
9//!
10//! Here we can see that the database request is handled by different layers. The `context` is the shared state.
11//! Each layer can clone the `context` but it must be noted that the values of the `context` are not cloned. A
12//! simple example of using the `context` is to keep track of the duration of the request, or if the process has
13//! been cancelled or not.
14
15// Copyright 2017 Thomas de Zeeuw
16//
17// https://docs.rs/io-context/0.2.0/io_context/
18//
19// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
20// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT
21// or http://opensource.org/licenses/MIT>, at your option. This file may not be
22// used, copied, modified, or distributed except according to those terms.
23
24pub use self::canceller::*;
25pub use self::context::*;
26
27pub mod cancellation;
28pub mod canceller;
29pub mod context;
30pub mod reason;