diff options
| author | Austin Hellyer <[email protected]> | 2016-11-05 23:10:44 -0700 |
|---|---|---|
| committer | Austin Hellyer <[email protected]> | 2016-11-05 23:10:44 -0700 |
| commit | 37ee7883398ffb2b4e4e9e1652468f9afbb7b57b (patch) | |
| tree | ca037c8d29163e50f2ce8e371c039ab6b2a7382d /src/prelude.rs | |
| parent | Convert all doc anchors to named anchors (diff) | |
| download | serenity-37ee7883398ffb2b4e4e9e1652468f9afbb7b57b.tar.xz serenity-37ee7883398ffb2b4e4e9e1652468f9afbb7b57b.zip | |
Add a prelude for userland
Users can now import all of a prelude via `use serenity::prelude::*;`,
which should provide some helpful stuff. As such, the internal
prelude is now named `serenity::prelude_internal`, and all internal uses
have been adjusted.
Diffstat (limited to 'src/prelude.rs')
| -rw-r--r-- | src/prelude.rs | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/prelude.rs b/src/prelude.rs index 45906bf..c5d8e20 100644 --- a/src/prelude.rs +++ b/src/prelude.rs @@ -1,9 +1,19 @@ -//! These prelude re-exports are a set of exports that are commonly used from -//! within the library. +//! A set of exports which can be helpful to use. //! -//! These are not publicly re-exported to the end user, and must stay as a -//! private module. +//! Note that the `SerenityError` re-export is equivilant 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: +//! +//! ```rust +//! use discord::prelude::*; +//! ``` +//! +//! [`serenity::Error`]: ../enum.Error.html -pub use serde_json::Value; -pub use ::error::{Error, Result}; -pub use ::client::ClientError; +pub use ::client::{Client, ClientError}; +pub use ::error::{Error as SerenityError}; +pub use ::model::Mentionable; |