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§
- impl_
arena_ 🔒allocatable_ decoder - impl_
arena_ 🔒allocatable_ decoders - impl_
arena_ 🔒copy_ decoder - impl_
decodable_ 🔒via_ ref
Constants§
- SHORTHAND_
OFFSET - The shorthand encoding uses an enum’s variant index
usize
and 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§
- decode_
arena_ 🔒allocable - decode_
arena_ 🔒allocable_ slice - encode_
with_ shorthand - Encode the given value or a previously cached shorthand.