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
64
65
66
67
68
//! Output adapter for [`crate::Engine::eval`] / [`crate::Session::eval`]
//! and the typed `eval_into::<T>` family.
//!
//! [`FromDataValue`] is the result-side counterpart of [`crate::EvalInput`]
//! / [`crate::IntoLogic`]: it turns a borrowed arena `DataValue` into the
//! caller's chosen output shape. Suffix variants on the public API
//! (`_str`, `_into::<T>`) are thin sugar around the matching impl.
//!
//! - [`datavalue::OwnedDataValue`] — deep-clone out of the arena.
//! - [`String`] — JSON via `Display` (matches `eval_str`).
//! - `serde_json::Value` (`serde_json`) — arena → serde walk.
//! - `T: DeserializeOwned` (`serde_json`) — arena → JSON → `T`.
//!
//! The trait is **sealed**.
use OwnedDataValue;
use crateResult;
use crateDataValue;
/// Convert a borrowed arena [`DataValue`] into a concrete result type.
///
/// Sealed trait — see the module docs for the supported output shapes.
// Note on `T: DeserializeOwned`: a blanket impl would overlap with the
// per-type impls above (every `OwnedDataValue` / `String` /
// `serde_json::Value` is also `DeserializeOwned`). The typed path is
// therefore exposed as an inherent method
// `Engine::eval_into::<T>(...)` / `Session::eval_into::<T>(...)` /
// `datalogic::eval_into::<T>(...)`, which calls
// `serde_json::from_value(value.to_serde_json())?` directly. See
// `top_level::eval_into` and the `Engine::eval_into` definition.