pub struct MessageContent {
pub data: Bytes,
pub reply_to: Option<[u8; 32]>,
pub thread_id: Option<[u8; 32]>,
pub metadata: HashMap<String, String>,
}Expand description
Plaintext message content before encryption
Fieldsยง
ยงdata: BytesThe actual message text or data
reply_to: Option<[u8; 32]>Optional reply-to message ID
thread_id: Option<[u8; 32]>Optional thread ID for threading support
metadata: HashMap<String, String>Message metadata (arbitrary key-value pairs)
Implementationsยง
Sourceยงimpl MessageContent
impl MessageContent
Sourcepub fn reply(message: impl Into<String>, reply_to: [u8; 32]) -> Self
pub fn reply(message: impl Into<String>, reply_to: [u8; 32]) -> Self
Create a reply to another message
Sourcepub fn with_metadata(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_metadata( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Add metadata to the message
Sourcepub fn with_thread(self, thread_id: [u8; 32]) -> Self
pub fn with_thread(self, thread_id: [u8; 32]) -> Self
Set thread ID for threaded conversations
Trait Implementationsยง
Sourceยงimpl Clone for MessageContent
impl Clone for MessageContent
Sourceยงfn clone(&self) -> MessageContent
fn clone(&self) -> MessageContent
Returns a duplicate of the value. Read more
1.0.0 ยท Sourceยงfn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSourceยงimpl Debug for MessageContent
impl Debug for MessageContent
Sourceยงimpl<'de> Deserialize<'de> for MessageContent
impl<'de> Deserialize<'de> for MessageContent
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
Sourceยงimpl PartialEq for MessageContent
impl PartialEq for MessageContent
Sourceยงimpl Serialize for MessageContent
impl Serialize for MessageContent
impl Eq for MessageContent
impl StructuralPartialEq for MessageContent
Auto Trait Implementationsยง
impl !Freeze for MessageContent
impl RefUnwindSafe for MessageContent
impl Send for MessageContent
impl Sync for MessageContent
impl Unpin for MessageContent
impl UnwindSafe for MessageContent
Blanket Implementationsยง
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