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
/// Creates a generic type alias `Name<T>` for [`Dynamic<T>`](crate::Dynamic).
///
/// Useful when you need a single reusable name for heap-allocated secrets of varying types.
///
/// *Requires feature `alloc`.*
///
/// # Syntax
///
/// ```text
/// dynamic_generic_alias!(pub Name, "doc string"); // public with custom doc
/// dynamic_generic_alias!(pub(crate) Name); // crate-visible, auto-generated doc
/// ```
///
/// # Examples
///
/// ```rust
/// use secure_gate::{dynamic_generic_alias, RevealSecret};
///
/// dynamic_generic_alias!(pub SecureBox, "Generic heap-allocated secret wrapper.");
///
/// let key: SecureBox<Vec<u8>> = vec![0u8; 32].into();
/// key.with_secret(|b| assert_eq!(b.len(), 32));
/// ```
///
/// # Implementation Notes
///
/// Macro-generated generic aliases lack runtime size checks. Validate expected
/// inner types and sizes in unit tests.
/// As with `dynamic_alias!`, zero-sized or empty inner types are permitted
/// (no compile-time size check is possible); validate non-zero size in tests.