|
1 | | -//! Module containing types for gateway sharding. |
| 1 | +//! Mechanisms for configuring and managing sharded gateway connections. |
2 | 2 | //! |
3 | 3 | //! Sharding is a method for load-balancing bots across separate threads or processes. Sharding is |
4 | 4 | //! enforced on bots by Discord once they reach a certain number of guilds (2500). Once this |
@@ -62,34 +62,31 @@ use crate::model::gateway::{GatewayIntents, ShardInfo}; |
62 | 62 | use crate::model::id::{ApplicationId, GuildId, ShardId}; |
63 | 63 | use crate::model::user::OnlineStatus; |
64 | 64 |
|
65 | | -/// A Shard is a higher-level handler for a websocket connection to Discord's gateway. |
| 65 | +/// An abstract handler for a websocket connection to Discord's gateway. |
66 | 66 | /// |
67 | | -/// The shard allows for sending and receiving messages over the websocket, |
68 | | -/// such as setting the active activity, reconnecting, syncing guilds, and more. |
| 67 | +/// Allows a user to send and receive messages over said websocket, including: |
| 68 | +/// * setting the current activity |
| 69 | +/// * setting the current online status |
| 70 | +/// * receiving gateway events |
| 71 | +/// * connection management via heartbeating |
69 | 72 | /// |
70 | | -/// Refer to the [module-level documentation][module docs] for information on effectively using |
71 | | -/// multiple shards, if you need to. |
72 | | -/// |
73 | | -/// Note that there are additional methods available if you are manually managing a shard yourself, |
74 | | -/// although they are hidden from the documentation since there are few use cases for doing so. |
| 73 | +/// Shard management (including starting, restarting, heartbeating), is performed by the [`Client`] |
| 74 | +/// automatically on the user's behalf. |
75 | 75 | /// |
76 | 76 | /// # Stand-alone shards |
77 | 77 | /// |
78 | 78 | /// You may instantiate a shard yourself - decoupled from the [`Client`] - by calling |
79 | 79 | /// [`Shard::new`]. Most use cases will not necessitate this, and unless you're doing something |
80 | 80 | /// really weird you can just let the client do it for you. |
81 | 81 | /// |
82 | | -/// **Note**: You _really_ do not need to do this. Just call one of the appropriate methods on the |
83 | | -/// [`Client`]. |
| 82 | +/// **Note**: You _really_ do not need to do this, especially if using multiple shards. Just call |
| 83 | +/// one of the appropriate methods on the [`Client`]. |
84 | 84 | /// |
85 | 85 | /// # Examples |
86 | 86 | /// |
87 | 87 | /// See the documentation for [`Self::new`] on how to use this. |
88 | 88 | /// |
89 | 89 | /// [`Client`]: crate::Client |
90 | | -/// [`receive`]: #method.receive |
91 | | -/// [docs]: https://discord.com/developers/docs/topics/gateway#sharding |
92 | | -/// [module docs]: crate::gateway#sharding |
93 | 90 | pub struct Shard { |
94 | 91 | pub client: WsClient, |
95 | 92 | presence: PresenceData, |
|
0 commit comments