Skip to content
Snippets Groups Projects
data.rs 995 B
Newer Older
CARDILE VINCENT's avatar
CARDILE VINCENT committed
// use serde::{
//     Serialize, 
//     Deserialize,  
// };
CARDILE VINCENT's avatar
CARDILE VINCENT committed
pub const REQUEST_BODY: &str = "{\"destination\":\"\", \"origin\": \"1\", \"control\": \"{1}\", \"data\": \"{2}\", \"identity\":\"{3}\"}, \"sender_identity\":\"{4}\"";
/*
* Node struct
*
* @param id: String node id
* @param chan: std::sync::mpsc::Sender<Value> channel to comunicate with the node
*/
pub struct Node {
    pub id: String,
CARDILE VINCENT's avatar
CARDILE VINCENT committed
    pub chan_s: std::sync::mpsc::Sender<Value>,
    pub chan_r: std::sync::mpsc::Receiver<Value>
}

pub struct Com {
    pub chan_s: std::sync::mpsc::Sender<Value>,
    pub chan_r: std::sync::mpsc::Receiver<Value>
}

/*
* Message struct
*
* @param id: String message id
* @param message: String message
*/
CARDILE VINCENT's avatar
CARDILE VINCENT committed
// #[derive(Serialize, Deserialize, Debug, Clone)]
// pub struct Message {
//     // pub id: String,
//     pub message: String
// }

#[derive(Clone)]
pub struct Flags {
    pub debug: bool,
    pub model: bool,
    pub model_name: String,