distant_net/manager/server/
config.rs

1use std::collections::HashMap;
2
3use super::{BoxedConnectHandler, BoxedLaunchHandler};
4
5/// Configuration settings for a manager.
6pub struct Config {
7    /// Scheme to use when none is provided in a destination for launch
8    pub launch_fallback_scheme: String,
9
10    /// Scheme to use when none is provided in a destination for connect
11    pub connect_fallback_scheme: String,
12
13    /// Buffer size for queue of incoming connections before blocking
14    pub connection_buffer_size: usize,
15
16    /// If listening as local user
17    pub user: bool,
18
19    /// Handlers to use for launch requests
20    pub launch_handlers: HashMap<String, BoxedLaunchHandler>,
21
22    /// Handlers to use for connect requests
23    pub connect_handlers: HashMap<String, BoxedConnectHandler>,
24}
25
26impl Default for Config {
27    fn default() -> Self {
28        Self {
29            // Default to using ssh to launch distant
30            launch_fallback_scheme: "ssh".to_string(),
31
32            // Default to distant server when connecting
33            connect_fallback_scheme: "distant".to_string(),
34
35            connection_buffer_size: 100,
36            user: false,
37            launch_handlers: HashMap::new(),
38            connect_handlers: HashMap::new(),
39        }
40    }
41}