From 794efe06d7fe5c51e845fcc4902c93f436391299 Mon Sep 17 00:00:00 2001 From: Marco Rotili Date: Sat, 10 Jul 2021 21:00:51 +0200 Subject: [PATCH] Adapt documentation --- src/default_client.rs | 13 ++++++++----- src/web_socket.rs | 14 ++++++++++++-- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/default_client.rs b/src/default_client.rs index a311b31..52c9a12 100644 --- a/src/default_client.rs +++ b/src/default_client.rs @@ -435,7 +435,6 @@ impl Client for DefaultClient { /// Authenticate a user with Apple Game Center /// /// See [Game center](https://heroiclabs.com/docs/authentication/#game-center) on how to set up authentication using the Apple Game Center. - /// todo! The documentation doesn't help here /// /// See [Authentication](index.html#authentication) for a description of the `username`, `create` and `vars` parameters. /// @@ -1170,7 +1169,6 @@ impl Client for DefaultClient { /// Link a Game Center profile to the social profiles on the current user's account. /// /// See [Game center](https://heroiclabs.com/docs/authentication/#game-center) on how to set up authentication using the Apple Game Center. - /// todo! The documentation doesn't help here /// /// # Example /// ``` @@ -1270,7 +1268,7 @@ impl Client for DefaultClient { /// /// The chat channel id can be retrieved by using [`Socket::join_chat`]. /// - /// TODO: How does forward work? + /// Specify `forward` to set the direction of the pagination. /// /// See [Limit and cursor](index.html#limit-and-cursor) for a description on how to use the `limit` and `cursor` parameters. /// @@ -1683,9 +1681,14 @@ impl Client for DefaultClient { self.send(request).await } - /// List current or upcoming + /// List current or upcoming tournaments /// - /// TODO: Document all + /// Use `category_start` and `category_end` to filter based on the category that is set on the server on tournament creation. The category value is between 0 and 127. + /// + /// Omitting the start and end time parameters returns the ongoing and future tournaments. + /// Setting the end time parameter to 0 only includes tournaments with no end time set in the results. + /// Setting end time to a > 0 unix timestamp acts as an upper bound and only returns tournaments that end prior to it (excluding tournaments with no end time). + /// Setting the start time to a > 0 unix timestamp returns any tournaments that start at a later time than it. /// /// See [Limit and cursor](index.html#limit-and-cursor) for a description on how to use the `limit` and `cursor`. /// diff --git a/src/web_socket.rs b/src/web_socket.rs index 3c37889..2dfc059 100644 --- a/src/web_socket.rs +++ b/src/web_socket.rs @@ -693,7 +693,8 @@ impl Socket for WebSocket { /// Connect to the server. /// - /// TODO: Document parameters. + /// If `appear_online` is false, no status updates will be sent to other clients. + /// /// # Example /// ``` /// # #![feature(async_closure)] @@ -813,9 +814,18 @@ impl Socket for WebSocket { let result_envelope = self.wait_response(cid).await?; Ok(result_envelope.status.unwrap()) } + /// Join a chat channel on the server. /// - /// TODO: Documentation + /// There are three channel types. Room (1), DirectMessage (2) and Group (3). + /// The `room_name` is the user id for a direct message, the group id for a group message and the room name otherwise. + /// + /// Set `persistence` to `false` to only receive messages while online. + /// Otherwise messages sent through channels are saved to the database and available in the message history later. + /// + /// Set `hidden` to `true` to hide your channel presence when connecting, so you will not generate join/leave notifications + /// and will not appear in listings of channel members. You can still send and receive messages. + /// /// # Example /// ``` /// # #![feature(async_closure)]