From b2400b60add42eb5e170bc392c6c971725d8a96e Mon Sep 17 00:00:00 2001 From: Joscha Date: Mon, 22 Aug 2022 16:45:25 +0200 Subject: [PATCH] Improve api documentation --- src/api/room_cmds.rs | 8 ++++++-- src/api/session_cmds.rs | 7 +++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/api/room_cmds.rs b/src/api/room_cmds.rs index 02dddd4..777dda3 100644 --- a/src/api/room_cmds.rs +++ b/src/api/room_cmds.rs @@ -1,4 +1,7 @@ //! Chat room commands. +//! +//! These commands are available to the client once a session successfully joins +//! a room. use serde::{Deserialize, Serialize}; @@ -17,8 +20,9 @@ pub struct GetMessageReply(pub Message); /// Request messages from the room's message log. /// -/// This can be used to supplement the log provided by snapshot-event (for -/// example, when scrolling back further in history). +/// This can be used to supplement the log provided by +/// [`SnapshotEvent`](super::SnapshotEvent) (for example, when scrolling back +/// further in history). #[derive(Debug, Clone, Serialize, Deserialize)] pub struct Log { /// Maximum number of messages to return (up to 1000). diff --git a/src/api/session_cmds.rs b/src/api/session_cmds.rs index e169f7d..4dab0d4 100644 --- a/src/api/session_cmds.rs +++ b/src/api/session_cmds.rs @@ -1,4 +1,7 @@ //! Session commands. +//! +//! Session management commands are involved in the initial handshake and +//! maintenance of a session. use serde::{Deserialize, Serialize}; @@ -6,8 +9,8 @@ use super::{AuthOption, Time}; /// Attempt to join a private room. /// -/// This should be sent in response to a bounce event at the beginning of a -/// session. +/// This should be sent in response to a [`BounceEvent`](super::BounceEvent) at +/// the beginning of a session. #[derive(Debug, Clone, Serialize, Deserialize)] pub struct Auth { /// The method of authentication.