[−][src]Struct fractal_matrix_api::types::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>
redacted: bool
in_reply_to: Option<String>
extra_content: Option<JsonValue>
Methods
impl Message
[src]
pub fn new(room: String, sender: String, body: String, mtype: String) -> Self
[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: &&JsonValue) -> 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: &JsonValue) -> 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 JsonValue>,
[src]
I: Iterator<Item = &'a JsonValue>,
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>)
[src]
Trait Implementations
impl Clone for Message
[src]
fn clone(&self) -> Message
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
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]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl PartialEq<Message> for Message
[src]
fn eq(&self, other: &Message) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl Debug for Message
[src]
impl Serialize for Message
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de> Deserialize<'de> for Message
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl Sync for Message
impl Send for Message
impl Unpin for Message
impl RefUnwindSafe for Message
impl UnwindSafe for Message
Blanket Implementations
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> Erased for T
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,