Expand description
Traits for generically dealing with a decoding framework.
The central traits are Decode and Decoder.
A type implementing Decode can use an Decoder to decode an instance of itself. This also comes with a derive allowing you to derive high performance decoding associated with native Rust types.
Note that using derives directly from musli_core requires you to use the
#[musli(crate = musli_core)] attribute.
§Examples
use musli_core::Decode;
#[derive(Decode)]
#[musli(crate = musli_core)]
pub struct Person<'a> {
name: &'a str,
age: u32,
}Enums§
- Skip
- Indicates if skipping was performed.
- TryFast
Decode - An outcome of a fast decode attempt.
Traits§
- AsDecoder
- Trait that allows a type to be repeatedly coerced into a decoder.
- Decode
- Trait governing how types are decoded.
- Decode
Bytes - Trait governing how types are decoded as bytes.
- Decode
Owned - Decode to an owned value.
- Decode
Packed - Trait governing how a type is decoded as a packed value.
- Decode
Slice Builder - Trait used to decode a slice into a type.
- Decode
Trace - Trait governing how types are decoded specifically for tracing.
- Decode
Unsized - A trait implemented for types which can only be decoded by reference.
- Decode
Unsized Bytes - A trait implemented for types which can be visited by reference.
- Decoder
- Trait governing the implementation of a decoder.
- Entries
Decoder - Trait governing how to decode a sequence of map pairs.
- Entry
Decoder - Trait governing how to decode a map entry.
- MapDecoder
- Trait governing how to decode a sequence of pairs.
- Sequence
Decoder - Trait governing how to decode a sequence.
- Unsized
Visitor - A visitor for data where we might need to borrow without copying from the
underlying
Decoder. - Variant
Decoder - Trait governing how to decode a variant.
- Visitor
- Visitor capable of decoding any type into a value
Visitor::Ok.
Attribute Macros§
- decoder
- This is an attribute macro that must be used when implementing a
Decoder. - unsized_
visitor - This is an attribute macro that must be used when implementing a
UnsizedVisitor. - visitor
- This is an attribute macro that must be used when implementing a
Visitor.
Derive Macros§
- Decode
- Derive which automatically implements the
Decodetrait.