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
46
47
use Context;
use crateHumusFormat;
/// Provides context from the query for use in the [HumusEngine].
///
/// Its main job is the provide the requested [HumusFormat]
/// so that the Engine knows which output to produce.
///
/// Example implementation:
/// ```
/// use lib_humus::HumusQuerySettings;
/// use lib_humus::HtmlTextJsonFormat;
///
/// // Reuse the HtmlTextJsonFormat for now.
/// pub type ExampleResponseFormat = HtmlTextJsonFormat;
///
/// #[derive(Clone)]
/// pub struct ExampleQuerySettings {
/// pub response_format: ExampleResponseFormat,
/// }
///
/// impl HumusQuerySettings<ExampleResponseFormat> for ExampleQuerySettings {
/// fn get_format(&self) -> ExampleResponseFormat {
/// return self.response_format.clone();
/// }
/// }
/// ```
///
/// [HumusEngine]: ./struct.HumusEngine.html
/// [HumusFormat]: ./trait.HumusFormat.html