pub enum VarValue {
Text(String),
Observation(String),
List(Vec<String>),
Int(i64),
UInt(u64),
Float(f64),
Absent,
}Expand description
A validated variable value at substitution time. Bounds were enforced by the typed constructors; this enum is what the renderer consumes.
Variants§
Text(String)
Locally trusted text, substituted verbatim.
Observation(String)
Untrusted text; rendered as a canonical observation block.
List(Vec<String>)
A bounded list; rendered in the variable’s declared style. An empty list omits the placeholder’s line.
Int(i64)
Canonical integer formatting (no locale).
UInt(u64)
Canonical unsigned formatting.
Float(f64)
Canonical float formatting (shortest round-trip; finite only).
Absent
Option::None: the placeholder’s line is omitted entirely.
Implementations§
Trait Implementations§
Source§impl<const COUNT: usize, const BYTES: usize> From<BoundedList<COUNT, BYTES>> for VarValue
impl<const COUNT: usize, const BYTES: usize> From<BoundedList<COUNT, BYTES>> for VarValue
Source§fn from(value: BoundedList<COUNT, BYTES>) -> Self
fn from(value: BoundedList<COUNT, BYTES>) -> Self
Converts to this type from the input type.
Source§impl<const N: usize> From<BoundedText<N>> for VarValue
impl<const N: usize> From<BoundedText<N>> for VarValue
Source§fn from(value: BoundedText<N>) -> Self
fn from(value: BoundedText<N>) -> Self
Converts to this type from the input type.
Source§impl<const N: usize> From<ObservationText<N>> for VarValue
impl<const N: usize> From<ObservationText<N>> for VarValue
Source§fn from(value: ObservationText<N>) -> Self
fn from(value: ObservationText<N>) -> Self
Converts to this type from the input type.
impl StructuralPartialEq for VarValue
Auto Trait Implementations§
impl Freeze for VarValue
impl RefUnwindSafe for VarValue
impl Send for VarValue
impl Sync for VarValue
impl Unpin for VarValue
impl UnsafeUnpin for VarValue
impl UnwindSafe for VarValue
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.