6 releases
new 0.1.12 | Sep 4, 2024 |
---|---|
0.1.11 | Aug 30, 2024 |
0.1.10 | Jul 22, 2024 |
#948 in Encoding
253 downloads per month
Used in 2 crates
(via argus-lib)
230KB
6.5K
SLoC
Remote serde::Serialize
derives for Rustc types
WARNING, these definitions were done hastily, and definitely need a little "fixing up." It will be done at some point. In the meantime, consume at your own risk.
Here is a quick guide to naming conventions used in this module. To Serialize types we try to rely on serde::remote when possible. These remote types by convention append a "Def" suffix to the type.
For example, rustc_middle::ty::Ty
is serialized as TyDef
.
Serializing rich source information is hard, and requires a step
of expansion and processing before all information is had. If you don't
believe this claim, take a peek at rustc_middle::ty::print::pretty
and
come back when you're convinced.
If a type requires expansion into a richer form, this is done inside the new
function.
If a type needs to be used within a serde with
attribute, then an associated function
serialize
is defined, and actual serialization will be deferred to the serialize
extension method.
If you need to serialize an optional type then prefix it with Option__
, and
lists of elements are serialized with a prefixed Slice__
.
Dependencies
~3.5–6MB
~111K SLoC