Expand description
Core traits for Müsli.
The Encode and Decode derives exported by this crate generate code
which refers to musli_core, so a crate which depends on musli_core alone
derives them without a #[musli(crate = ..)] attribute:
use musli_core::{Decode, Encode};
#[derive(Encode, Decode)]
pub struct Person<'a> {
name: &'a str,
age: u32,
}If musli_core is renamed in Cargo.toml, such as with musli_core01 = { package = "musli-core", .. }, the derives have to be told the new name with
#[musli(crate = musli_core01)].
Re-exports§
pub use self::de::Decode;pub use self::de::Decoder;pub use self::en::Encode;pub use self::en::Encoder;
Modules§
- alloc
- Müsli Rust core allocation and collections library
- de
- Traits for generically dealing with a decoding framework.
- display
- Encode a value through
Displayand decode it throughFromStr. - en
- Traits for generically dealing with an encoding framework.
- hint
- Core encoding hints.
- mode
- Type that describe a mode of encoding.
Traits§
- Allocator
- An allocator that can be used in combination with a context.
- Context
- Provides ergonomic access to the serialization context.
- Decode
- Trait governing how types are decoded.
- Decoder
- Trait governing how decoding is implemented for a given format.
- Encode
- Trait governing how types are encoded.
- Encoder
- Trait governing how encoding is implemented for a given format.
Attribute Macros§
- trait_
defaults - This is an attribute macro that must be used when implementing the following traits:
Derive Macros§
- Decode
- Derive which automatically implements the
Decodetrait. - Encode
- Derive which automatically implements the
Encodetrait.