cal-core 0.2.158

Callable core lib
Documentation
use std::fmt::{Debug, Formatter};
use serde::{Serialize, Deserialize};
use crate::device::device::Connector;
use crate::{ConnectState, FlowState};
use crate::router_option::RouterOption;

#[derive(Serialize, Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
pub struct ZoneRouter {
    #[serde(default)]
    pub options: Vec<RouterOption>,
    #[serde(default = "crate::device::shared::build_connect_to")]
    pub connect_to: String,
}

impl Connector for ZoneRouter {
    fn get_connect_to(&mut self, _state: &mut FlowState) -> ConnectState {
        // Implementation would depend on how zone routing works
        // This is a placeholder based on the structure in the original code
        ConnectState::default(&self.connect_to, None)
    }
}

impl Debug for ZoneRouter {
    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
        f.debug_struct("ZoneRouter")
            .field("options", &self.options)
            .field("connect_to", &self.connect_to)
            .finish()
    }
}