aboutsummaryrefslogtreecommitdiff
path: root/src/prelude.rs
Commit message (Collapse)AuthorAgeFilesLines
* Break up the model moduleZeyla Hellyer2017-12-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `model` module has historically been one giant module re-exporting all of the model types, which is somewhere around 100 types. This can be a lot to look at for a new user and somewhat overwhelming, especially with a large number of fine-grained imports from the module. The module is now neatly split up into submodules, mostly like it has been internally since the early versions of the library. The submodules are: - application - channel - error - event - gateway - guild - id - invite - misc - permissions - prelude - user - voice - webhook Each submodule contains types that are "owned" by the module. For example, the `guild` submodule contains, but not limited to, Emoji, AuditLogsEntry, Role, and Member. `channel` contains, but not limited to, Attachment, Embed, Message, and Reaction. Upgrade path: Instead of glob importing the models via `use serenity::model::*;`, instead glob import via the prelude: ```rust use serenity::model::prelude::*; ``` Instead of importing from the root model module: ```rust use serenity::model::{Guild, Message, OnlineStatus, Role, User}; ``` instead import from the submodules like so: ```rust use serenity::model::channel::Message; use serenity::model::guild::{Guild, Role}; use serenity::model::user::{OnlineStatus, User}; ```
* Fix parking_lot::{Mutex, RwLock} re-exportsZeyla Hellyer2017-11-091-2/+1
| | | | | | | | Fix the re-exports for `parking_lot::{Mutex, RwLock}` no longer functioning due to the conditional compilation gate removal (`parking_lot` is now always compiled). Tests have been updated to ensure the functionality of these re-exports.
* Fix no-parking_lot compilationZeyla Hellyer2017-11-011-1/+2
| | | | | | Fixes compilation without the `parking_lot` crate compiled. The prelude re-exposed `parking_lot`'s `Mutex` and `RwLock`, but didn't do so conditionally.
* Re-export parking_lot::{Arc, Mutex} from preludeZeyla Hellyer2017-10-191-0/+1
| | | | | | These two types are used in public APIs, and so by re-exporting them it makes it easier for the user to use them without needing to depend on `parking_lot` themselves.
* rustfmtacdenisSK2017-07-271-12/+12
|
* Also update examplesacdenisSK2017-06-291-1/+1
|
* Update readme, docs and add `EventHandler` to the preludeacdenisSK2017-06-281-1/+1
|
* Re-export all errors from the preludeZeyla Hellyer2017-06-141-0/+8
|
* Restructure modulesZeyla Hellyer2017-05-221-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Modules are now separated into a fashion where the library can be used for most use cases, without needing to compile the rest. The core of serenity, with no features enabled, contains only the struct (model) definitions, constants, and prelude. Models do not have most functions compiled in, as that is separated into the `model` feature. The `client` module has been split into 3 modules: `client`, `gateway`, and `http`. `http` contains functions to interact with the REST API. `gateway` contains the Shard to interact with the gateway, requiring `http` for retrieving the gateway URL. `client` requires both of the other features and acts as an abstracted interface over both the gateway and REST APIs, handling the event loop. The `builder` module has been separated from `utils`, and can now be optionally compiled in. It and the `http` feature are required by the `model` feature due to a large number of methods requiring access to them. `utils` now contains a number of utilities, such as the Colour struct, the `MessageBuilder`, and mention parsing functions. Each of the original `ext` modules are still featured, with `cache` not requiring any feature to be enabled, `framework` requiring the `client`, `model`, and `utils`, and `voice` requiring `gateway`. In total the features and their requirements are: - `builder`: none - `cache`: none - `client`: `gateway`, `http` - `framework`: `client`, `model`, `utils` - `gateway`: `http` - `http`: none - `model`: `builder`, `http` - `utils`: none - `voice`: `gateway` The default features are `builder`, `cache`, `client`, `framework`, `gateway`, `model`, `http`, and `utils`. To help with forwards compatibility, modules have been re-exported from their original locations.
* Fix typoIllia2016-12-311-1/+1
|
* Clarify some docsAustin Hellyer2016-11-301-1/+1
|
* Fix doc importAustin Hellyer2016-11-061-1/+1
|
* Add a prelude for userlandAustin Hellyer2016-11-051-7/+17
| | | | | | | 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.
* Initial commitAustin Hellyer2016-10-181-0/+9