Adds about one billion (+- a few hundred million) missing derives for
all sorts of types.
The biggest change in this PR is, how structs holding a property
`Shared<T>` types implement `PartialEq`. In previous versions of this
crate, if a `Shared<T>` was part of a struct, this or these properties
would be ignored in == comparisons. This is because `Shared<T>` is
defined as `Arc<RwLock<T>>` - meaning you'd have to lock the `RwLock` to
make a comparison. From now on, instead of ignoring these properties or
locking the inner `RwLock`, the pointer values of the `Arc<T>`'s get
compared. This is a cheap and exact way of ensuring `Eq` for types,
which have an inner `Shared<T>`.
This PR replaces our internal `Observer` trait with a more generic
version, as offered by our `pubserve` crate.
This also has the added benefit of removing the... creative logic used
in `Observer::unsubscribe()` which did not check the memory the internal
`Arc` points to, but rather some weird
```rs
self.observers
.retain(|obs| format!("{:?}", obs) != to_remove);
```
which was written ages ago by a version of me that was still at the very
beginning of learning Rust
- fix `PATCH /users/@me` - It incorrectly returned a required password error, even if the current password was set
- fix `GET /users/@me/guilds` - It incorrectly sent body parameters instead of query ones
- don't log debug! for every successful ratelimited request - use trace! so it's less spamy
- update the max expected compression ratio (several times) from 20 to 200. let's hope that will be enough
- fix deserialization errors relating to guild folders in user settings
- fix a panic in `SqlxBitFlags` if there are extra flags. It now truncates them
- update `chorus_macros` to 0.4.1 (due to the above fix)
- log (trace!) event data if we fail to parse it or it's unrecognised, for debugging purposes
- fix a deserialization error in the `MessageACK` event
- fix `public_flags` in user objects not being `PublicFlags` bitflags
* Fix SQL encode/decode for GuildFeatures
* Use distinct PermissionFlags type
* Add Emoji schema types, modify GuildBan with feature lock
* Add Schemas for pruning guild members
* Add schemas for interfacing with stickers backend routes
* Add schemas for interfacing with vanity-url backend routes
* Add schema for interfacing with guilds/id/welcome-screen route
* Make all Option<Vec> types Vec types with #[serde(default)]
* Add various types to support guilds/* api routes
* Add missing enums and structs for searching messages
* Use proper distinct types
* Add EmbedType enum
* Use distinct PermissionFlags type
* Changes supporting backend for VoiceState
* Changes supporting backend for AuditLog's
* feat: add GatewayOptions
* feat: implement zlib-stream compression
This also changes how gateway messages work.
Now each gateway backend converts its message into an
intermediary RawGatewayMessage, from which we inflate
and parse GatewayMessages.
Thanks to ByteAlex and their zlib-stream-rs crate, which
helped me understand how to parse a compressed websocket stream
- Bumps chorus macros to 0.4.0, followup to #505
- Makes builds within the repo use the local path and published releases
use a set version of the macros crate
- Adds a multitude of new Types, Flags, and a few Objects relating to
sending and managing messages.
- Adds new SqlxBitFlag macro, which handles BitFlag objects being read
from/written to the database.
- Modifies some entities to use (new) Distinct Types instead of
primitives