cal-core 0.2.158

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

#[derive(Serialize, Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
pub struct Event {
    #[serde(default = "crate::device::shared::build_connect_to")]
    pub connect_to: String,
}

impl Connector for Event {
    fn get_connect_to(&mut self, _state: &mut FlowState) -> ConnectState {
        ConnectState::default(&self.connect_to, None)
    }
}

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