Module prelude

Source
Expand description

A set of exports which can be helpful to use.

Note that the SerenityError re-export is equivalent to serenity::Error, although is re-exported as a separate name to remove likely ambiguity with other crate error enums.

§Examples

Import all of the exports:

use serenity::prelude::*;

Re-exports§

pub use crate::client::Context;
pub use crate::client::Client;
pub use crate::client::ClientError;
pub use crate::client::EventHandler;
pub use crate::client::RawEventHandler;
pub use crate::gateway::GatewayError;
pub use crate::http::CacheHttp;
pub use crate::http::HttpError;
pub use crate::model::mention::Mentionable;
pub use crate::model::gateway::GatewayIntents;
pub use crate::model::ModelError;

Structs§

Mutex
An asynchronous Mutex-like type.
RwLock
An asynchronous reader-writer lock.
TypeMap
TypeMap is a simple abstraction around the standard library’s HashMap type, where types are its keys. This allows for statically-checked value retrieval.

Enums§

SerenityError
A common error enum returned by most of the library’s functionality within a custom Result.

Traits§

TypeMapKey
TypeMapKey is used to declare key types that are eligible for use with TypeMap.