surrealdb_core/ctx/
mod.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//! This module defines and handles the `context` for the SurrealDB database.
//! ## Concept
//! The context is shared through the code. To understand the context of `context` we must appreciate that
//! there are different layers to the SurrealDB database. Whilst at this point in time there is no definition
//! of all the layers in code, we can illustrate the layers with the following lifecycle of a database request:
//! - we start with an SQL statement
//! - the SQL statement is then parsed into an operation
//! - we then go down to the key value store . . .
//!
//! Here we can see that the database request is handled by different layers. The `context` is the shared state.
//! Each layer can clone the `context` but it must be noted that the values of the `context` are not cloned. A
//! simple example of using the `context` is to keep track of the duration of the request, or if the process has
//! been cancelled or not.

// Copyright 2017 Thomas de Zeeuw
//
// https://docs.rs/io-context/0.2.0/io_context/
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT
// or http://opensource.org/licenses/MIT>, at your option. This file may not be
// used, copied, modified, or distributed except according to those terms.

pub use self::canceller::*;
pub use self::context::*;

pub mod cancellation;
pub mod canceller;
pub mod context;
pub mod reason;