aboutsummaryrefslogtreecommitdiff
path: root/src/http/ratelimiting.rs
Commit message (Collapse)AuthorAgeFilesLines
* A bunch of typo fixes (#404)Perry Fraser2018-10-011-2/+2
|
* Move low-level http functions to a raw moduleZeyla Hellyer2018-08-241-1/+1
| | | | | | Move the low-level http functions that work with serde maps directly into an `http::raw` module, and re-export them from the `http` module for backwards compatibility purposes.
* Fix all the dead links in the docsErk-2018-08-091-3/+3
|
* [http] Abstract out routing methods and pathsZeyla Hellyer2018-08-051-265/+18
|
* Redo how requests are formed in HTTP moduleZeyla Hellyer2018-08-041-10/+9
| | | | | | | | | | Instead of passing around a function that builds an HTTP client request builder, pass around a struct that contains the necessary information _to_ build that request builder. Additionally, instead of using a macro to generate requests, just call a request function. This saves some required code expansion and is just easier to read and maintain.
* Add http::ratelimiting::offsetZeyla Hellyer2018-07-041-13/+23
| | | | | Add a function to access a copy of the ratelimiting module's internal `OFFSET` static binding.
* Remove extraneous spaces at the end of linesZeyla Hellyer2018-06-171-2/+2
|
* Take 'Date' header into account when ratelimitingZeyla Hellyer2018-04-271-2/+61
| | | | | | | Take the 'Date' header into account when ratelimiting so that a server-client time offset can be calculated. This improves ratelimiting precision on the seconds-level, but is still prone to bad millisecond precision offsets.
* Refactor imports/exports to use nested groups and better formattingacdenisSK2018-03-291-4/+8
|
* Add 'Get Guild Vanity Url' endpointZeyla Hellyer2018-02-091-0/+6
| | | | Docs: <https://github.com/discordapp/discord-api-docs/commit/98f6643703012d2f3780ba730ce1191120f85dcd>
* Fix broken docs links caused by model mod changesZeyla Hellyer2018-01-311-13/+13
| | | | | Fix broken links caused by the `model` module changes in v0.5.0, which split up the module into sub-modules for better organization.
* Re-order use statements alphabeticallyZeyla Hellyer2017-11-111-1/+1
|
* Update to account for changes made in 0.4.1acdenisSK2017-10-141-3/+2
|\
| * Fix clippy lintsZeyla Hellyer2017-10-111-3/+2
| |
| * Fix most clippy warningsMaiddog2017-10-041-1/+1
| |
* | Switch to parking_lot::{Mutex, RwLock}Zeyla Hellyer2017-10-101-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switch to the `parking_lot` crate's implementations of `std::sync::Mutex` and `std::sync::RwLock`, which are more efficient. A writeup on why `parking_lot` is more efficient can be read here: <https://github.com/Amanieu/parking_lot> Upgrade path: Modify `mutex.lock().unwrap()` usage to `mutex.lock()` (not needing to unwrap or handle a result), and `rwlock.read().unwrap()`/`rwlock.write().unwrap()` usage to `rwlock.read()` and `rwlock.write()`. For example, modify: ```rust use serenity::CACHE; println!("{}", CACHE.read().unwrap().user.id); ``` to: ```rust use serenity::CACHE; println!("{}", CACHE.read().user.id); ```
* | Make webhook_id a majour parameter in ratelimitingZeyla Hellyer2017-10-091-1/+1
| | | | | | | | | | This change is made due to this change in documentation: <https://github.com/discordapp/discord-api-docs/commit/32d06c360867cead6aa785ff10c437fdb2743bd6?short_path=5f625d6#diff-5f625d6c4303e22c3d6af4c8d6df28fe>
* | Fix most clippy warningsMaiddog2017-10-091-1/+1
|/
* Apply rustfmtZeyla Hellyer2017-09-181-12/+13
|
* Apply rustfmtZeyla Hellyer2017-09-181-1/+3
|
* Use combinators in `parse_header`acdenisSK2017-09-171-14/+7
|
* Add ability to play DCA and Opus files. (#148)Maiddog2017-08-271-16/+19
|
* Revamp `RwLock` usage in the libacdenisSK2017-08-241-19/+16
| | | | Also not quite sure if they goofed rustfmt or something, but its changes it did were a bit bizarre.
* Fix rustfmt lines that are too longZeyla Hellyer2017-08-181-1/+3
| | | | | Apparently rustfmt can't fix some of these, causing it to exit with 3 and therefore failing the build.
* Apply rustfmtZeyla Hellyer2017-08-181-7/+11
|
* Clippy and rustfmtacdenisSK2017-08-011-1/+2
|
* Remove a few clonesacdenisSK2017-07-291-2/+1
|
* Change the config a bit, and a few nitpicksacdenisSK2017-07-271-34/+32
|
* rustfmtacdenisSK2017-07-271-29/+39
|
* Add an actual way to fetch audit log entries from a guildacdenisSK2017-07-201-0/+5
|
* Update dependenciesZeyla Hellyer2017-06-211-2/+2
|
* Switch from #[doc(hidden)] to pub(crate)alex2017-06-141-6/+3
| | | | | | Switch from using `#[doc(hidden)]` to hide some internal functions to `pub(crate)`. The library now requires rustc 1.18.
* Use chrono for struct timestamp fieldsZeyla Hellyer2017-06-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Chrono is easier to use than timestamped strings, so they should be automatically deserialized and available for the user, instead of having the user deserialize the strings themselves. These fields have been changed to use a type of `DateTime<FixedOffset>`: - `ChannelPinsUpdateEvent.last_pin_timestamp` - `Group.last_pin_timestamp` - `Guild.joined_at` - `GuildChannel.last_pin_timestamp` - `Invite.created_at` - `Member.joined_at` - `Message.edited_timestamp - `Message.timestamp` - `MessageUpdateEvent.edited_timestamp` - `MessageUpdateEvent.timestamp` - `PrivateChannel.last_pin_timestamp` `Member.joined_at` is now also an `Option`. Previously, if a Guild Member Update was received for a member not in the cache, a new Member would be instantiated with a default String value. This is incorrect behaviour, and has now been replaced with being set to `None` in that case. Id methods' `created_at()` method now return a `chrono::NaiveDateTime` instead of a `time::Timespec`, and `User::created_at` has been updated to reflect that. Additionally, drop `time` as a direct dependency and use chrono for internals.
* Fix ratelimiting::ROUTES doctestZeyla Hellyer2017-05-301-1/+1
| | | | | Values are now wrapped within an Arc<Mutex>, so the example needs to obtain a lock and unwrap it.
* Include more info on ratelimiting debugsZeyla Hellyer2017-05-301-7/+7
| | | | | In addition to the amount of time sleeping, include the route being ratelimited.
* Fix ratelimits causing 429s in certain situationsZeyla Hellyer2017-05-301-17/+18
|
* Clippy lintsZeyla Hellyer2017-05-241-3/+3
|
* Restructure modulesZeyla Hellyer2017-05-221-0/+504
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.