pub struct ChatMessage {
pub id: u64,
pub token: String,
pub actor_type: String,
pub actor_id: String,
pub actor_display_name: String,
pub timestamp: i64,
pub message: String,
pub system_message: String,
}Expand description
A chat message within a Nextcloud Talk conversation.
Fields§
§id: u64Unique identifier of the chat message.
token: StringToken of the conversation this message belongs to.
actor_type: StringActor type of the sender (e.g. "users", "bots", "guests").
actor_id: StringActor identifier of the sender (e.g. user ID).
actor_display_name: StringDisplay name of the sender.
timestamp: i64Unix timestamp when the message was posted (in seconds).
message: StringText content of the message.
system_message: StringSystem message identifier if this is a system event, otherwise empty.
Implementations§
Source§impl ChatMessage
impl ChatMessage
Sourcepub fn new(
id: u64,
token: impl Into<String>,
actor_type: impl Into<String>,
actor_id: impl Into<String>,
actor_display_name: impl Into<String>,
timestamp: i64,
message: impl Into<String>,
system_message: impl Into<String>,
) -> Self
pub fn new( id: u64, token: impl Into<String>, actor_type: impl Into<String>, actor_id: impl Into<String>, actor_display_name: impl Into<String>, timestamp: i64, message: impl Into<String>, system_message: impl Into<String>, ) -> Self
Creates a new ChatMessage.
Sourcepub fn is_system_message(&self) -> bool
pub fn is_system_message(&self) -> bool
Returns true if this message represents a system event.
Trait Implementations§
Source§impl Clone for ChatMessage
impl Clone for ChatMessage
Source§impl Debug for ChatMessage
impl Debug for ChatMessage
Source§impl<'de> Deserialize<'de> for ChatMessage
impl<'de> Deserialize<'de> for ChatMessage
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 Eq for ChatMessage
Source§impl PartialEq for ChatMessage
impl PartialEq for ChatMessage
Source§impl Serialize for ChatMessage
impl Serialize for ChatMessage
impl StructuralPartialEq for ChatMessage
Auto Trait Implementations§
impl Freeze for ChatMessage
impl RefUnwindSafe for ChatMessage
impl Send for ChatMessage
impl Sync for ChatMessage
impl Unpin for ChatMessage
impl UnsafeUnpin for ChatMessage
impl UnwindSafe for ChatMessage
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