openc2/
actuator.rs

1//! Types for declaring entities that will execute actions on targets.
2
3/// Information about the entity that will execute the action on the target.
4#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Hash, FromVariants)]
5#[serde(rename_all = "snake_case")]
6pub enum Actuator {
7    Endpoint(Endpoint),
8    NetworkRouter(NetworkRouter),
9    #[doc(hidden)]
10    NonExhaustive,
11}
12
13#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Hash)]
14pub struct Endpoint(String);
15
16impl Endpoint {
17    pub fn new<S>(name: S) -> Self where S: Into<String> {
18        Endpoint(name.into())
19    }
20}
21
22#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Hash)]
23pub struct NetworkRouter {
24    actuator_id: String,
25}