cal_core/device/
inbound_flow.rs

1use std::fmt::{Debug, Formatter};
2use serde::{Serialize, Deserialize};
3use crate::{ConnectState, FlowState};
4use crate::device::device::Connector;
5
6#[derive(Serialize, Deserialize, Clone)]
7#[serde(rename_all = "camelCase")]
8pub struct InboundFlow {
9    #[serde(default)]
10    pub ddis: Vec<String>,
11    #[serde(default = "crate::device::shared::build_connect_to")]
12    pub connect_to: String,
13}
14
15impl Connector for InboundFlow {
16    fn get_connect_to(&mut self, _state: &mut FlowState) -> ConnectState {
17        ConnectState::default(&self.connect_to, None)
18    }
19}
20
21impl Debug for InboundFlow {
22    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
23        f.debug_struct("InboundFlow")
24            .field("ddis", &self.ddis)
25            .field("connect_to", &self.connect_to)
26            .finish()
27    }
28}