pub enum Value {
Null,
Bool(bool),
Int(i64),
Float(f64),
String(String),
Coord(Coord),
Color(Color),
Layer(Layer),
List(Vec<Value>),
Binary(Vec<u8>),
}Expand description
Dynamic value type for Altium data, similar to serde_json::Value.
This enum represents any value that can appear in an Altium record, enabling dynamic access without compile-time type knowledge.
Variants§
Null
Null or missing value
Bool(bool)
Boolean value
Int(i64)
Integer value
Float(f64)
Floating-point value
String(String)
String value
Coord(Coord)
Coordinate value (preserves fractional precision)
Color(Color)
Color value (Win32 COLORREF)
Layer(Layer)
Layer value
List(Vec<Value>)
List of values (comma-separated in params)
Binary(Vec<u8>)
Raw binary data
Implementations§
Source§impl Value
impl Value
Sourcepub fn as_bool_or(&self, default: bool) -> bool
pub fn as_bool_or(&self, default: bool) -> bool
Returns the boolean value, or a default.
Sourcepub fn as_float_or(&self, default: f64) -> f64
pub fn as_float_or(&self, default: f64) -> f64
Returns the float value, or a default.
Sourcepub fn as_str_or<'a>(&'a self, default: &'a str) -> &'a str
pub fn as_str_or<'a>(&'a self, default: &'a str) -> &'a str
Returns the string value, or a default.
Sourcepub fn as_coord_or(&self, default: Coord) -> Coord
pub fn as_coord_or(&self, default: Coord) -> Coord
Returns the coordinate value, or a default.
Sourcepub fn from_param_value(pv: &ParameterValue) -> Self
pub fn from_param_value(pv: &ParameterValue) -> Self
Creates a Value from a ParameterValue, inferring the type.
Trait Implementations§
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
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,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more