Expand description
This module contains some shared code for encoding and decoding various
things from the ty module, and in particular implements support for
“shorthands” which allow to have pointers back into the already encoded
stream instead of re-encoding the same thing twice.
The functionality in here is shared between persisting to crate metadata and persisting to incr. comp. caches.
Macros§
Constants§
- SHORTHAND_
OFFSET - The shorthand encoding uses an enum’s variant index
usizeand is offset by this value so it never matches a real variant. This offset is also chosen so that the first byte is never < 0x80.
Traits§
- Encodable
With Shorthand - RefDecodable
- Trait for decoding to a reference.
- TyDecoder
- TyEncoder
Functions§
- encode_
with_ shorthand - Encode the given value or a previously cached shorthand.