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