1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//! Traits for generically dealing with an encoding framework.
//!
//! The central traits are [Encode] and [Encoder].
//!
//! A type implementing [Encode] can use an [Encoder] to encode itself. This
//! also comes with a derive allowing you to derive high performance encoding
//! associated with native Rust types.
//!
//! ```
//! use musli::Encode;
//!
//! #[derive(Encode)]
//! pub struct Person<'a> {
//! name: &'a str,
//! age: u32,
//! }
//! ```
/// Derive which automatically implements the [`Encode` trait].
///
/// See the [`derives` module] for detailed documentation.
///
/// [`derives` module]: crate::_help::derives
/// [`Encode` trait]: trait@Encode
///
/// # Examples
///
/// ```
/// use musli::Encode;
///
/// #[derive(Encode)]
/// struct MyType {
/// data: [u8; 128],
/// }
/// ```
///
/// When using through `musli_core`, the crate needs to be specified:
///
/// ```
/// use musli_core::Encode;
///
/// #[derive(Encode)]
/// #[musli(crate = musli_core)]
/// struct MyType {
/// data: [u8; 128],
/// }
/// ```
pub use Encode;
pub use ;
pub use utils;