about summary refs log tree commit diff stats
path: root/src/smd/context.rs
blob: d8194c5be1bb13deec6f0a270e95b921c3f516a4 (plain) (blame)
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
use super::Config;
use salaryman::service::Service;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use std::sync::Arc;
use tokio::sync::Mutex;

pub struct SalarymanDContext {
    pub config: Config,
    pub service: Vec<Arc<Mutex<Service>>>,
}
impl SalarymanDContext {
    pub fn new() -> Self {
        Self {
            config: Config::new(),
            service: Vec::new(),
        }
    }
    pub fn from_parts(config: Config, service: Vec<Arc<Mutex<Service>>>) -> Self {
        Self { config, service }
    }
}

#[derive(Serialize, Deserialize, JsonSchema, Debug)]
pub struct StdinBuffer {
    pub string: String,
}