[][src]Module serenity::model

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 self::error::Error as ModelError;
pub use self::permissions::Permissions;

Modules

application

Models about OAuth2 applications.

channel

Models relating to channels and types within channels.

error

Error enum definition wrapping potential model implementation errors.

event

All the events this library handles.

gateway

Models pertaining to the gateway.

guild

Models relating to guilds and types that it owns.

id

A collection of newtypes defining type-strong IDs.

invite

Models for server and channel invites.

misc

Miscellaneous helper traits, enums, and structs for models.

permissions

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

prelude

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

user

User information-related models.

voice

Representations of voice information.

webhook

Webhook model and implementations.