distant_net/manager/data/request.rs
1use distant_auth::msg::AuthenticationResponse;
2use serde::{Deserialize, Serialize};
3
4use super::{ManagerAuthenticationId, ManagerChannelId};
5use crate::common::{ConnectionId, Destination, Map, UntypedRequest};
6
7#[allow(clippy::large_enum_variant)]
8#[derive(Clone, Debug, Serialize, Deserialize)]
9#[serde(rename_all = "snake_case", deny_unknown_fields, tag = "type")]
10pub enum ManagerRequest {
11 /// Retrieve information about the manager's version.
12 Version,
13
14 /// Launch a server using the manager
15 Launch {
16 // NOTE: Boxed per clippy's large_enum_variant warning
17 destination: Box<Destination>,
18
19 /// Additional options specific to the connection
20 options: Map,
21 },
22
23 /// Initiate a connection through the manager
24 Connect {
25 // NOTE: Boxed per clippy's large_enum_variant warning
26 destination: Box<Destination>,
27
28 /// Additional options specific to the connection
29 options: Map,
30 },
31
32 /// Submit some authentication message for the manager to use with an active connection
33 Authenticate {
34 /// Id of the authentication request that is being responded to
35 id: ManagerAuthenticationId,
36
37 /// Response being sent to some active connection
38 msg: AuthenticationResponse,
39 },
40
41 /// Opens a channel for communication with an already-connected server
42 OpenChannel {
43 /// Id of the connection
44 id: ConnectionId,
45 },
46
47 /// Sends data through channel
48 Channel {
49 /// Id of the channel
50 id: ManagerChannelId,
51
52 /// Untyped request to send through the channel
53 request: UntypedRequest<'static>,
54 },
55
56 /// Closes an open channel
57 CloseChannel {
58 /// Id of the channel to close
59 id: ManagerChannelId,
60 },
61
62 /// Retrieve information about a specific connection
63 Info { id: ConnectionId },
64
65 /// Kill a specific connection
66 Kill { id: ConnectionId },
67
68 /// Retrieve list of connections being managed
69 List,
70}