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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//! Application state for stately-arrow API handlers.
use SessionContext;
use crate::;
/// State required by the API handlers.
///
/// Wraps a [`QueryContext`] and can be extracted from your application state
/// using axum's `FromRef` pattern.
///
/// # Example
///
/// ```rust,ignore
/// use axum::extract::FromRef;
/// use stately_arrow::{QueryContext, QuerySession, QueryState};
///
/// #[derive(Clone)]
/// pub struct AppState {
/// pub query_context: QueryContext<MySession>,
/// pub other_field: String,
/// }
///
/// impl FromRef<AppState> for QueryState<MySession> {
/// fn from_ref(state: &AppState) -> Self {
/// Self::new(state.query_context.clone())
/// }
/// }
/// ```