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
//! Doctests for the `IntoEngineData` derive macro.
//!
//! `IntoEngineData` converts a Rust struct into the `EngineData` representation.
//! See the `IntoEngineData` trait for details.
//! `#[derive(IntoEngineData)]` implements the `IntoEngineData` trait for the struct.
//!
//! What is valid:
//! - A **named-field struct** (a regular `struct Foo { a: T, b: U }`)
//!
//! What is not valid (and should fail to compile):
//! - A **unit struct** (`struct Foo;`) — no fields to convert into engine data.
//! - A **tuple struct** (`struct Foo(T, U);`) — the macro expects named fields.
/// ```
/// # use buoyant_kernel as delta_kernel;
/// # use delta_kernel_derive::IntoEngineData;
/// #[derive(IntoEngineData)]
/// pub struct WithFields {
/// some_name: String,
/// count: i32,
/// }
/// ```
;
/// ```compile_fail
/// # use buoyant_kernel as delta_kernel;
/// # use delta_kernel_derive::IntoEngineData;
/// #[derive(IntoEngineData)]
/// pub struct NoFields;
/// ```
;
/// ```compile_fail
/// # use buoyant_kernel as delta_kernel;
/// # use delta_kernel_derive::IntoEngineData;
/// #[derive(IntoEngineData)]
/// pub struct TupleStruct(String, i32);
/// ```
;