kanidmd_core/actors/
mod.rs

1//! This module contains the server's async tasks that are called from the various frontend
2//! components to conduct operations. These are separated based on protocol versions and
3//! if they are read or write transactions internally.
4
5use kanidmd_lib::idm::ldap::LdapServer;
6use kanidmd_lib::idm::server::IdmServer;
7use std::sync::Arc;
8
9pub struct QueryServerReadV1 {
10    pub(crate) idms: Arc<IdmServer>,
11    ldap: Arc<LdapServer>,
12}
13
14impl QueryServerReadV1 {
15    pub fn new(idms: Arc<IdmServer>, ldap: Arc<LdapServer>) -> Self {
16        debug!("Starting query server read worker ...");
17        QueryServerReadV1 { idms, ldap }
18    }
19
20    pub fn start_static(idms: Arc<IdmServer>, ldap: Arc<LdapServer>) -> &'static Self {
21        let x = Box::new(QueryServerReadV1::new(idms, ldap));
22
23        let x_ref = Box::leak(x);
24        &(*x_ref)
25    }
26}
27
28pub struct QueryServerWriteV1 {
29    pub(crate) idms: Arc<IdmServer>,
30}
31
32impl QueryServerWriteV1 {
33    pub fn new(idms: Arc<IdmServer>) -> Self {
34        debug!("Starting a query server write worker ...");
35        QueryServerWriteV1 { idms }
36    }
37
38    pub fn start_static(idms: Arc<IdmServer>) -> &'static QueryServerWriteV1 {
39        let x = Box::new(QueryServerWriteV1::new(idms));
40
41        let x_ptr = Box::leak(x);
42        &(*x_ptr)
43    }
44}
45
46pub mod internal;
47pub mod v1_read;
48pub mod v1_scim;
49pub mod v1_write;