pub struct Message {
pub from: EntityId,
pub metadata: MessageMetadata,
pub content: MessageContent,
}Expand description
A message that is part of a conversation.
Fields§
§from: EntityIdThe id of who sent this message.
metadata: MessageMetadataAuto-generated metadata for this message.
If missing during deserialization, uses MessageMetadata::epoch instead
of MessageMetadata::default.
content: MessageContentThe parsed content of this message ready to present.
Implementations§
Source§impl Message
impl Message
Sourcepub fn set_content(&mut self, content: MessageContent)
pub fn set_content(&mut self, content: MessageContent)
Set the content of a message as a whole (also updates metadata).
Sourcepub fn update_content(&mut self, f: impl FnOnce(&mut MessageContent))
pub fn update_content(&mut self, f: impl FnOnce(&mut MessageContent))
Update specific parts of the content of a message (also updates metadata).
Trait 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 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§
§impl<T> ActionTrait for T
impl<T> ActionTrait for T
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.