Module serenity::model[][src]

Expand description

Mappings of objects received from the API, with optional helper methods for ease of use.

Models can optionally have additional helper methods compiled, by enabling the model feature.

Normally you can import models through the sub-modules:

use serenity::model::channel::{ChannelType, GuildChannel, Message};
use serenity::model::id::{ChannelId, GuildId};
use serenity::model::user::User;

This can get a bit tedious - especially with a large number of imports - so this can be simplified by simply glob importing everything from the prelude:

use serenity::model::prelude::*;

Re-exports

pub use serenity_voice_model as voice_gateway;
pub use self::error::Error as ModelError;
pub use self::permissions::Permissions;

Modules

Models about OAuth2 applications.

Models relating to channels and types within channels.

Models for user connections.

Error enum definition wrapping potential model implementation errors.

All the events this library handles.

Models pertaining to the gateway.

Models relating to guilds and types that it owns.

A collection of newtypes defining type-strong IDs.

interactionsunstable_discord_api

Models for server and channel invites.

Miscellaneous helper traits, enums, and structs for models.

A set of permissions for a role or user. These can be assigned directly to a role or as a channel’s permission overrides.

The model prelude re-exports all types in the model sub-modules.

User information-related models.

Representations of voice information.

Webhook model and implementations.