Skip to content

Commit

Permalink
Doc improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
novacrazy committed Apr 14, 2024
1 parent 6b1f46a commit 1f51e75
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions src/models/gateway.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ pub mod events {
#[cfg_attr(feature = "rkyv", archive(check_bytes))]
pub struct ReadyParty {
pub party: Party,

/// The user's own member object
pub me: PartyMember,
}

Expand Down Expand Up @@ -164,8 +166,14 @@ pub mod events {
#[cfg_attr(feature = "rkyv", archive(check_bytes))]
pub struct Ready {
pub user: User,
pub dms: ThinVec<Room>,

/// The parties the user is in, including DMs.
pub parties: ThinVec<ReadyParty>,

/// Contains all rooms the user is in, including DMs.
pub rooms: ThinVec<Room>,

/// Gateway session ID, used for resuming sessions
pub session: Snowflake,
}

Expand Down Expand Up @@ -521,13 +529,19 @@ pub mod message {
#[doc = "An archived [`" $name "`]" ]
#[repr(u8, align(1))]
pub enum [<Archived $name>] {
$($opcode(Archived<[<$name:snake _payloads>]::[<$opcode Payload>]>) = ArchivedTag::$opcode as u8,)*
$(
#[doc = "Archived counterpart of [`" $name "::" $opcode "`]" ]
$opcode(Archived<[<$name:snake _payloads>]::[<$opcode Payload>]>) = ArchivedTag::$opcode as u8,
)*
}

#[doc = "Resolver for an archived [`" $name "`]" ]
#[repr(u8)]
pub enum [<$name Resolver>] {
$($opcode(Resolver<[<$name:snake _payloads>]::[<$opcode Payload>]>) = $code,)*
$(
#[doc = "Resolver for [`" $name "::" $opcode "`]" ]
$opcode(Resolver<[<$name:snake _payloads>]::[<$opcode Payload>]>) = $code,
)*
}

$(
Expand Down

0 comments on commit 1f51e75

Please sign in to comment.