Skip to main content

sonic/executor/
mod.rs

1// Sonic
2//
3// Fast, lightweight and schema-less search backend
4// Copyright: 2019, Valerian Saliou <valerian@valeriansaliou.name>
5// Copyright: 2026, Rémi Bardon <remi@remibardon.name>
6// License: Mozilla Public License v2.0 (MPL v2.0)
7
8use std::sync::Arc;
9
10#[macro_use]
11mod macros;
12
13mod count;
14mod flushb;
15mod flushc;
16mod flusho;
17mod list;
18mod pop;
19mod push;
20mod search;
21mod suggest;
22
23pub struct Executor {
24    pub app_conf: Arc<crate::Config>,
25    pub kv_pool: crate::store::kv::StoreKVPool,
26    pub fst_pool: crate::store::fst::StoreFSTPool,
27}
28
29impl std::fmt::Debug for Executor {
30    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
31        // NOTE: Deconstructing to future-proof this function.
32        let Self {
33            kv_pool,
34            fst_pool,
35            // NOTE: We don’t care about the app configuration,
36            //   we can see it elsewhere if needed.
37            app_conf: _app_conf,
38        } = self;
39
40        f.debug_struct("Executor")
41            .field("kv_pool", kv_pool)
42            .field("fst_pool", fst_pool)
43            .finish_non_exhaustive()
44    }
45}