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
use ;
/// Builder for creating `ValueDescriptions` programmatically.
///
/// This builder allows you to construct value descriptions when building DBC files
/// programmatically. It validates that entries are within limits and non-empty.
///
/// # Examples
///
/// ```rust,no_run
/// use dbc_rs::ValueDescriptionsBuilder;
///
/// let value_descriptions = ValueDescriptionsBuilder::new()
/// .add_entry(0, "Park")
/// .add_entry(1, "Reverse")
/// .add_entry(2, "Neutral")
/// .add_entry(3, "Drive")
/// .build()?;
///
/// assert_eq!(value_descriptions.get(0), Some("Park"));
/// assert_eq!(value_descriptions.get(1), Some("Reverse"));
/// # Ok::<(), dbc_rs::Error>(())
/// ```
///
/// # Validation
///
/// The builder validates:
/// - At least one entry is required (non-empty)
/// - Maximum of 64 value descriptions (MAX_VALUE_DESCRIPTIONS)
/// - Description names must not exceed MAX_NAME_SIZE
///
/// # Feature Requirements
///
/// This builder requires the `std` feature to be enabled.