[−][src]Struct matrix_bot_api::Message
Fields
sender: String
mtype: String
body: String
date: DateTime<Local>
room: String
thumb: Option<String>
url: Option<String>
id: String
formatted_body: Option<String>
format: Option<String>
source: Option<String>
receipt: HashMap<String, i64, RandomState>
redacted: bool
in_reply_to: Option<String>
extra_content: Option<Value>
Methods
impl Message
[src]
pub fn new(room: String, sender: String, body: String, mtype: String) -> Message
[src]
pub fn types() -> [&'static str; 2]
[src]
List all supported types. By default a message map a m.room.message event, but there's other events that we want to show in the message history so we map other event types to our Message struct, like stickers
pub fn supported_event(ev: &&Value) -> bool
[src]
Helper function to use in iterator filter of a matrix.org json response to filter supported events
pub fn parse_room_message(roomid: &str, msg: &Value) -> Message
[src]
Parses a matrix.org event and return a Message object
Arguments
roomid
- The message room idmsg
- The message event as Json
pub fn from_json_events_iter<'a, I>(roomid: &str, events: I) -> Vec<Message> where
I: Iterator<Item = &'a Value>,
[src]
I: Iterator<Item = &'a Value>,
Create a vec of Message from a json event list
roomid
- The messages room idevents
- An iterator to the json events
pub fn set_receipt(&mut self, receipt: HashMap<String, i64, RandomState>)
[src]
Trait Implementations
impl Clone for Message
[src]
impl Debug for Message
[src]
impl<'de> Deserialize<'de> for Message
[src]
fn deserialize<__D>(
__deserializer: __D
) -> Result<Message, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
[src]
__deserializer: __D
) -> Result<Message, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
impl PartialEq<Message> for Message
[src]
impl PartialOrd<Message> for Message
[src]
fn partial_cmp(&self, other: &Message) -> Option<Ordering>
[src]
#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl Serialize for Message
[src]
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
[src]
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Auto Trait Implementations
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnwindSafe for Message
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,