pub struct Message {
pub id: Uuid,
pub user: User,
pub channel_id: Uuid,
pub text: String,
pub plain_text: String,
pub embedded: Vec<EmbeddedInfo>,
pub created_at: TimeStamp,
pub updated_at: TimeStamp,
}Expand description
§Example
use traq_bot_http::payloads::types::Message;
let payload = r##"{
"id": "bc9106b3-f9b2-4eca-9ba1-72b39b40954e",
"user": {
"id": "dfdff0c9-5de0-46ee-9721-2525e8bb3d45",
"name": "takashi_trap",
"displayName": "寺田 健二",
"iconId": "2bc06cda-bdb9-4a68-8000-62f907f36a92",
"bot": false
},
"channelId": "9aba50da-f605-4cd0-a428-5e4558cb911e",
"text": "!{\"type\": \"user\", \"raw\": \"@takashi_trap\", \"id\": \"dfdff0c9-5de0-46ee-9721-2525e8bb3d45\"} こんにちは",
"plainText": "@takashi_trap こんにちは",
"embedded": [
{
"raw": "@takashi_trap",
"type": "user",
"id": "dfdff0c9-5de0-46ee-9721-2525e8bb3d45"
}
],
"createdAt": "2019-05-08T13:33:51.632149265Z",
"updatedAt": "2019-05-08T13:33:51.632149265Z"
}"##;
let payload: Message = payload.parse()?;
println!("{payload}");Fields§
§id: Uuid§user: User§channel_id: Uuid§text: String§plain_text: String§embedded: Vec<EmbeddedInfo>§created_at: TimeStamp§updated_at: TimeStampTrait Implementations§
Source§impl<'de> Deserialize<'de> for Message
impl<'de> Deserialize<'de> for Message
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Message
impl StructuralPartialEq for Message
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnwindSafe for Message
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)