Files
darkfi/example/dchat/src/dchatmsg.rs
2022-10-20 12:02:04 +02:00

20 lines
394 B
Rust

// ANCHOR: msg
use async_std::sync::{Arc, Mutex};
use darkfi::net;
use darkfi_serial::{SerialDecodable, SerialEncodable};
pub type DchatMsgsBuffer = Arc<Mutex<Vec<DchatMsg>>>;
impl net::Message for DchatMsg {
fn name() -> &'static str {
"DchatMsg"
}
}
#[derive(Debug, Clone, SerialEncodable, SerialDecodable)]
pub struct DchatMsg {
pub msg: String,
}
// ANCHOR_END: msg