Struct seshat::Event [−][src]
pub struct Event { pub event_type: EventType, pub content_value: String, pub msgtype: Option<String>, pub event_id: String, pub sender: String, pub server_ts: i64, pub room_id: String, pub source: String, }
Expand description
Matrix event that can be added to the database.
Fields
event_type: EventType
The type of the event.
content_value: String
The textual representation of a message, this part of the event will be indexed.
msgtype: Option<String>
The type of the message if the event is of a m.room.message type.
event_id: String
The unique identifier of this event.
sender: String
The MXID of the user who sent this event.
server_ts: i64
Timestamp in milliseconds on the originating Homeserver when this event was sent.
room_id: String
The ID of the room associated with this event.
source: String
The serialized JSON string of the event. This string will be returned by a search later on.
Implementations
Create a new event.
Arguments
event_type
- The type of the event.content_value
- The plain text value of the content, body for a message event, topic for a topic event and name for a name event.event_id
- The unique identifier of the event.sender
- The unique identifier of the event author.server_ts
- The timestamp of the event.room_id
- The unique identifier of the room that the event belongs to.source
- The serialized version of the event.
Trait Implementations
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
Auto Trait Implementations
impl RefUnwindSafe for Event
impl UnwindSafe for Event
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
type Output = T
type Output = T
Should always be Self
pub fn vzip(self) -> V