diff options
| author | Illia K <[email protected]> | 2016-11-28 12:28:23 +0000 |
|---|---|---|
| committer | Austin Hellyer <[email protected]> | 2016-11-28 10:16:22 -0800 |
| commit | 6c2c7b73d9fb5ed46b642e323065c560ffef9ef2 (patch) | |
| tree | 8cb587fd6fcd8e3e06f8960475ea2a54432e3d18 /src/model/id.rs | |
| parent | Add an initial tiny test suite to get Travis going (diff) | |
| download | serenity-6c2c7b73d9fb5ed46b642e323065c560ffef9ef2.tar.xz serenity-6c2c7b73d9fb5ed46b642e323065c560ffef9ef2.zip | |
Improve docs and add new message builder methods
Add documentation for some missing methods - such as Game methods - and
add more methods to the Message Builder.
Diffstat (limited to 'src/model/id.rs')
| -rw-r--r-- | src/model/id.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/model/id.rs b/src/model/id.rs index cba72ae..5f534ec 100644 --- a/src/model/id.rs +++ b/src/model/id.rs @@ -50,6 +50,7 @@ impl ChannelId { } impl From<Channel> for ChannelId { + /// Gets the Id of a `Channel`. fn from(channel: Channel) -> ChannelId { match channel { Channel::Group(group) => group.channel_id, @@ -60,18 +61,21 @@ impl From<Channel> for ChannelId { } impl From<PrivateChannel> for ChannelId { + /// Gets the Id of a private channel. fn from(private_channel: PrivateChannel) -> ChannelId { private_channel.id } } impl From<GuildChannel> for ChannelId { + /// Gets the Id of a guild channel. fn from(public_channel: GuildChannel) -> ChannelId { public_channel.id } } impl From<Emoji> for EmojiId { + /// Gets the Id of an `Emoji`. fn from(emoji: Emoji) -> EmojiId { emoji.id } @@ -122,42 +126,49 @@ impl GuildId { } impl From<PartialGuild> for GuildId { + /// Gets the Id of a partial guild. fn from(guild: PartialGuild) -> GuildId { guild.id } } impl From<GuildInfo> for GuildId { + /// Gets the Id of Guild information struct. fn from(guild_info: GuildInfo) -> GuildId { guild_info.id } } impl From<InviteGuild> for GuildId { + /// Gets the Id of Invite Guild struct. fn from(invite_guild: InviteGuild) -> GuildId { invite_guild.id } } impl From<Guild> for GuildId { + /// Gets the Id of Guild. fn from(live_guild: Guild) -> GuildId { live_guild.id } } impl From<Integration> for IntegrationId { + /// Gets the Id of integration. fn from(integration: Integration) -> IntegrationId { integration.id } } impl From<Message> for MessageId { + /// Gets the Id of a `Message`. fn from(message: Message) -> MessageId { message.id } } impl From<Role> for RoleId { + /// Gets the Id of a `Role`. fn from(role: Role) -> RoleId { role.id } @@ -192,18 +203,21 @@ impl RoleId { } impl From<CurrentUser> for UserId { + /// Gets the Id of a `CurrentUser` struct. fn from(current_user: CurrentUser) -> UserId { current_user.id } } impl From<Member> for UserId { + /// Gets the Id of a `Member`. fn from(member: Member) -> UserId { member.user.id } } impl From<User> for UserId { + /// Gets the Id of a `User`. fn from(user: User) -> UserId { user.id } |