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
//! Embedded Systems Support Module
//!
//! Aggregates compile-time configuration, memory limits, and lightweight alternatives for YAML parsing
//! on resource-constrained embedded environments. Includes numeric type recommendations and memory optimization tips.
//!
//! Copyright (c) 2026 YAML Library Developers
//! - `Numeric::Float(f64)`
//! - `Numeric::UInteger(u64)`
//!
//! ## Helper Methods
//!
//! When the `embedded` feature is enabled, `Numeric` provides helper methods:
//! - `to_i32()` - Convert any numeric to i32 (returns Option)
//! - `to_f32()` - Convert any numeric to f32
//! - `fits_in_i32()` - Check if value can be represented as i32
//! - `size_bytes()` - Get memory footprint of the variant
//!
//! ## Example Usage
//!
//! ```rust,ignore
//! use babbel_yaml::nodes::node::{Node, Numeric};
//!
//! // Prefer Int32 instead of Integer for embedded
//! let small_num = Node::Number(Numeric::Int32(42)); // 4 bytes
//! // Instead of: Node::Number(Numeric::Integer(42)) // 8 bytes
//!
//! // Convert existing numbers to embedded-friendly types
//! let num = Numeric::Integer(123);
//! if let Some(i32_val) = num.to_i32() {
//! // Use i32_val in embedded context
//! }
//!
//! // Check memory footprint
//! let size = num.size_bytes(); // Returns 8 for Integer variant
//! ```
//!
//! ## Memory Savings
//!
//! By using Int32 instead of Integer throughout your code:
//! - 50% reduction in numeric storage (4 bytes vs 8 bytes)
//! - Better cache utilization on 32-bit embedded processors
//! - Reduced heap pressure in constrained environments
/// Configuration constants for embedded systems
/// Runtime and compile-time limits for embedded systems
/// Lightweight node representation for embedded systems
/// Custom allocator support for embedded systems