Crates.io | twilight-model |
lib.rs | twilight-model |
version | 0.16.0-rc.1 |
source | src |
created_at | 2020-08-30 02:50:53.368746 |
updated_at | 2024-02-21 17:17:02.380488 |
description | Discord API models for the Twilight ecosystem. |
homepage | https://twilight.rs/chapter_1_crates/section_1_model.html |
repository | https://github.com/twilight-rs/twilight.git |
max_upload_size | |
id | 282535 |
size | 1,260,900 |
See the twilight
documentation for more information.
twilight-model
is a crate of serde models defining the Discord APIs with
few convenience methods on top of them.
These are in a single crate for ease of use, a single point of definition, and a sort of versioning of the Discord API. Similar to how a database schema progresses in versions, the definition of the API also progresses in versions.
The types in this crate are reproducible: deserializing a payload into a type, serializing it, and then deserializing it again will work.
Defined are a number of modules defining types returned by or owned by
resource categories. For example, gateway
are types used to interact with
and returned by the gateway API. guild
contains types owned by the Guild
resource category. These types may be directly returned by, built on top of,
or extended by other crates.
Some models have associated builders, which can be found in the
twilight-util
crate.