diff options
| author | mat <github@matdoes.dev> | 2022-10-30 12:58:44 -0500 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-10-30 12:58:44 -0500 |
| commit | 99d3a5de9d56bcb4f0367d8c8d6277ad14edd973 (patch) | |
| tree | 0219675f82b2f6208f3fafb3cf9a4cded0847d53 /azalea-protocol/src | |
| parent | f73872c0ccdce0f442832114382839850506058d (diff) | |
| download | azalea-drasl-99d3a5de9d56bcb4f0367d8c8d6277ad14edd973.tar.xz | |
improve docs a little more
Diffstat (limited to 'azalea-protocol/src')
| -rw-r--r-- | azalea-protocol/src/connect.rs | 37 | ||||
| -rwxr-xr-x | azalea-protocol/src/lib.rs | 3 |
2 files changed, 21 insertions, 19 deletions
diff --git a/azalea-protocol/src/connect.rs b/azalea-protocol/src/connect.rs index 06aedef9..c0c1a622 100644 --- a/azalea-protocol/src/connect.rs +++ b/azalea-protocol/src/connect.rs @@ -55,26 +55,24 @@ pub struct WriteConnection<W: ProtocolPacket> { /// hostname: address.host.to_string(), /// port: address.port, /// intention: ConnectionProtocol::Login, -/// } -/// .get(), -/// ) -/// .await?; -/// let mut conn = conn.login(); +/// }.get()); /// -/// // login -/// conn.write( -/// ServerboundHelloPacket { -/// username, -/// public_key: None, -/// profile_id: None, -/// } -/// .get(), -/// ) -/// .await?; +/// .await?; +/// let mut conn = conn.login(); +/// +/// // login +/// conn.write( +/// ServerboundHelloPacket { +/// username, +/// public_key: None, +/// profile_id: None, +/// } +/// .get(), +/// ) +/// .await?; /// -/// let (conn, game_profile) = loop { -/// let packet_result = conn.read().await; -/// match packet_result { +/// let (conn, game_profile) = loop { +/// let packet_result = conn.read().await?; /// Ok(packet) => match packet { /// ClientboundLoginPacket::Hello(p) => { /// let e = azalea_crypto::encrypt(&p.public_key, &p.nonce).unwrap(); @@ -87,7 +85,8 @@ pub struct WriteConnection<W: ProtocolPacket> { /// .get(), /// ) /// .await?; -/// conn.set_encryption_key(e.secret_key); } +/// conn.set_encryption_key(e.secret_key); +/// } /// ClientboundLoginPacket::LoginCompression(p) => { /// conn.set_compression_threshold(p.compression_threshold); /// } diff --git a/azalea-protocol/src/lib.rs b/azalea-protocol/src/lib.rs index ab447210..84306142 100755 --- a/azalea-protocol/src/lib.rs +++ b/azalea-protocol/src/lib.rs @@ -3,6 +3,9 @@ //! You should probably use [`azalea`] or [`azalea_client`] instead, as //! azalea_protocol delegates much of the work, such as auth, to the user of //! the crate. +//! +//! [`azalea`]: https://crates.io/crates/azalea +//! [`azalea_client`]: https://crates.io/crates/azalea-client // these two are necessary for thiserror backtraces #![feature(error_generic_member_access)] |
