pub struct Messages { /* private fields */ }Expand description
Message operations for a room.
Cheap to Clone (Arc-backed via Client) and Send + Sync.
Implementations§
Source§impl Messages
impl Messages
Sourcepub fn send(&self, text: impl Into<String>) -> SendMessage
pub fn send(&self, text: impl Into<String>) -> SendMessage
Sends a new message to this room.
POST /chat/v4/rooms/{roomName}/messages. Only retry-safe when an
idempotency_key is supplied (ADR-0006).
Sourcepub fn get(&self, serial: impl Into<Serial>) -> GetMessage
pub fn get(&self, serial: impl Into<Serial>) -> GetMessage
Fetches a single message by its serial (latest version).
GET /chat/v4/rooms/{roomName}/messages/{serial}. Retry-safe.
Sourcepub fn update(
&self,
serial: impl Into<Serial>,
text: impl Into<String>,
) -> UpdateMessage
pub fn update( &self, serial: impl Into<Serial>, text: impl Into<String>, ) -> UpdateMessage
Updates (edits) a message, fully replacing its content.
PUT /chat/v4/rooms/{roomName}/messages/{serial}. This is a
full replace: the supplied text and any
metadata /
headers become the message’s entire new
content. Omitted fields are reset to empty, not left unchanged — to
preserve existing metadata/headers you must resend them. Produces a new
version with action message.update. Only retry-safe when an
idempotency_key is supplied (ADR-0006).
Sourcepub fn delete(&self, serial: impl Into<Serial>) -> DeleteMessage
pub fn delete(&self, serial: impl Into<Serial>) -> DeleteMessage
Soft-deletes a message.
POST /chat/v4/rooms/{roomName}/messages/{serial}/delete — a POST to a
/delete sub-resource, not an HTTP DELETE. Produces a new version
with action message.delete; the message remains retrievable with its
delete action applied. Only retry-safe when an
idempotency_key is supplied (ADR-0006).
Sourcepub fn history(&self) -> History
pub fn history(&self) -> History
Queries message history.
GET /chat/v4/rooms/{roomName}/messages, paginated. Retry-safe. Defaults
to newest first (direction = backwards) and limit = 100, matching
the JS SDK. .await for the first Page<Message>, or
into_stream to follow all pages.
Sourcepub fn versions(&self, serial: impl Into<Serial>) -> Versions
pub fn versions(&self, serial: impl Into<Serial>) -> Versions
Queries all versions (create, updates, deletes) of a message.
GET /chat/v4/rooms/{roomName}/messages/{serial}/versions, paginated.
Retry-safe. .await for the first Page<Message>, or
into_stream to follow all pages.