-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Expand file tree
/
Copy pathmod.rs
More file actions
34 lines (28 loc) · 969 Bytes
/
mod.rs
File metadata and controls
34 lines (28 loc) · 969 Bytes
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
28
29
30
31
32
33
34
pub mod async;
pub mod sync;
use std::result;
use hyper::Method;
pub use self::async::{AsyncOutcome, AsyncOutcomeReceiver, AsyncOutcomeSender, AsyncRequest,
AsyncRequestBody};
pub use self::sync::{APILoggerDescription, BootSourceBody, DriveDescription, NetworkInterfaceBody,
SyncOutcomeReceiver, SyncOutcomeSender, SyncRequest, VsockJsonBody};
pub mod instance_info;
pub enum ParsedRequest {
Dummy,
GetInstanceInfo,
GetActions,
GetAction(String),
// the first String is the id
Async(String, AsyncRequest, AsyncOutcomeReceiver),
Sync(SyncRequest, SyncOutcomeReceiver),
}
// This enum represents a message which is passed to the VMM to request the execution
// of a certain action.
#[derive(Debug)]
pub enum ApiRequest {
Async(AsyncRequest),
Sync(SyncRequest),
}
pub trait IntoParsedRequest {
fn into_parsed_request(self, method: Method) -> result::Result<ParsedRequest, String>;
}