musli_core

Module de

Source
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,
}

Structs§

Enums§

  • Indicates if skipping was performed.

Traits§

  • Trait that allows a type to be repeatedly coerced into a decoder.
  • Trait governing how types are decoded.
  • Trait governing how types are decoded as bytes.
  • Decode to an owned value.
  • Trait governing how a type is decoded as a packed value.
  • Trait governing how types are decoded specifically for tracing.
  • A trait implemented for types which can only be decoded by reference.
  • A trait implemented for types which can be visited by reference.
  • Trait governing the implementation of a decoder.
  • Trait governing how to decode a sequence of map pairs.
  • Trait governing how to decode a map entry.
  • Trait governing how to decode a sequence of pairs.
  • Trait governing how to decode a sequence.
  • A visitor for data where we might need to borrow without copying from the underlying Decoder.
  • Trait governing how to decode a variant.
  • Visitor capable of decoding any type into a value Visitor::Ok.

Derive Macros§