Struct ruma::events::room::message::MessageEventContent [−][src]
pub struct MessageEventContent {
pub msgtype: MessageType,
pub relates_to: Option<Relation>,
}
events
only.Expand description
The payload for MessageEvent
.
Fields
msgtype: MessageType
A key which identifies the type of message being sent.
This also holds the specific content of each message.
relates_to: Option<Relation>
Information about related messages for rich replies.
Implementations
Create a MessageEventContent
with the given MessageType
.
A constructor to create a plain text message.
A constructor to create an html message.
A constructor to create a plain text notice.
pub fn notice_html(
body: impl Into<String>,
html_body: impl Into<String>
) -> MessageEventContent
pub fn notice_html(
body: impl Into<String>,
html_body: impl Into<String>
) -> MessageEventContent
A constructor to create an html notice.
pub fn text_reply_plain(
reply: impl Into<String>,
original_message: &MessageEvent<MessageEventContent>
) -> MessageEventContent
pub fn text_reply_plain(
reply: impl Into<String>,
original_message: &MessageEvent<MessageEventContent>
) -> MessageEventContent
Creates a plain text reply to a message.
pub fn text_reply_html(
reply: impl Into<String>,
html_reply: impl Into<String>,
original_message: &MessageEvent<MessageEventContent>
) -> MessageEventContent
pub fn text_reply_html(
reply: impl Into<String>,
html_reply: impl Into<String>,
original_message: &MessageEvent<MessageEventContent>
) -> MessageEventContent
Creates a html text reply to a message.
pub fn notice_reply_plain(
reply: impl Into<String>,
original_message: &MessageEvent<MessageEventContent>
) -> MessageEventContent
pub fn notice_reply_plain(
reply: impl Into<String>,
original_message: &MessageEvent<MessageEventContent>
) -> MessageEventContent
Creates a plain text notice reply to a message.
pub fn notice_reply_html(
reply: impl Into<String>,
html_reply: impl Into<String>,
original_message: &MessageEvent<MessageEventContent>
) -> MessageEventContent
pub fn notice_reply_html(
reply: impl Into<String>,
html_reply: impl Into<String>,
original_message: &MessageEvent<MessageEventContent>
) -> MessageEventContent
Creates a html text notice reply to a message.
Trait Implementations
pub fn deserialize<D>(
deserializer: D
) -> Result<MessageEventContent, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
pub fn deserialize<D>(
deserializer: D
) -> Result<MessageEventContent, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
A matrix event identifier, like m.room.message
.
Constructs the given event content.
Performs the conversion.
Performs the conversion.
The redacted form of the event’s content.
Transform self
into a redacted form (removing most or all fields) according to the spec. Read more
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for MessageEventContent
impl Send for MessageEventContent
impl Sync for MessageEventContent
impl Unpin for MessageEventContent
impl UnwindSafe for MessageEventContent
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more