diff options
Diffstat (limited to 'src/model/channel/mod.rs')
| -rw-r--r-- | src/model/channel/mod.rs | 53 |
1 files changed, 31 insertions, 22 deletions
diff --git a/src/model/channel/mod.rs b/src/model/channel/mod.rs index eadc7bb..5487a0b 100644 --- a/src/model/channel/mod.rs +++ b/src/model/channel/mod.rs @@ -555,29 +555,38 @@ impl Display for Channel { } } +/// A representation of a type of channel. +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, PartialOrd, Ord)] +pub enum ChannelType { + /// An indicator that the channel is a text [`GuildChannel`]. + /// + /// [`GuildChannel`]: struct.GuildChannel.html + Text = 0, + /// An indicator that the channel is a [`PrivateChannel`]. + /// + /// [`PrivateChannel`]: struct.PrivateChannel.html + Private = 1, + /// An indicator that the channel is a voice [`GuildChannel`]. + /// + /// [`GuildChannel`]: struct.GuildChannel.html + Voice = 2, + /// An indicator that the channel is the channel of a [`Group`]. + /// + /// [`Group`]: struct.Group.html + Group = 3, + /// An indicator that the channel is the channel of a [`ChannelCategory`]. + /// + /// [`ChannelCategory`]: struct.ChannelCategory.html + Category = 4, +} + enum_number!( - /// A representation of a type of channel. ChannelType { - #[doc="An indicator that the channel is a text [`GuildChannel`]. - -[`GuildChannel`]: struct.GuildChannel.html"] - Text = 0, - #[doc="An indicator that the channel is a [`PrivateChannel`]. - -[`PrivateChannel`]: struct.PrivateChannel.html"] - Private = 1, - #[doc="An indicator that the channel is a voice [`GuildChannel`]. - -[`GuildChannel`]: struct.GuildChannel.html"] - Voice = 2, - #[doc="An indicator that the channel is the channel of a [`Group`]. - -[`Group`]: struct.Group.html"] - Group = 3, - #[doc="An indicator that the channel is the channel of a [`ChannelCategory`]. - -[`ChannelCategory`]: struct.ChannelCategory.html"] - Category = 4, + Text, + Private, + Voice, + Group, + Category, } ); @@ -633,7 +642,7 @@ impl<'de> Deserialize<'de> for PermissionOverwrite { Ok(PermissionOverwrite { allow: data.allow, deny: data.deny, - kind: kind, + kind, }) } } |