You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
375 B
19 lines
375 B
use chrono::offset::Utc; |
|
use chrono::DateTime; |
|
use serde::Deserialize; |
|
use serde::Serialize; |
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize)] |
|
pub struct Message { |
|
received: DateTime<Utc>, |
|
message: String, |
|
} |
|
|
|
impl Message { |
|
pub fn new(message: &str) -> Self { |
|
Self { |
|
received: Utc::now(), |
|
message: message.into(), |
|
} |
|
} |
|
}
|
|
|