pub struct ParameterValue { /* private fields */ }Expand description
Value of a parameter with typed conversion methods.
Implementations§
Source§impl ParameterValue
impl ParameterValue
Sourcepub fn as_string_or(&self, default: &str) -> String
pub fn as_string_or(&self, default: &str) -> String
Gets the string value, or a default if empty.
Sourcepub fn as_int(&self) -> Result<i32, ParseIntError>
pub fn as_int(&self) -> Result<i32, ParseIntError>
Parses the value as an integer.
Sourcepub fn as_int_or(&self, default: i32) -> i32
pub fn as_int_or(&self, default: i32) -> i32
Gets the value as an integer, or a default on parse failure.
Sourcepub fn as_double(&self) -> Result<f64, ParseFloatError>
pub fn as_double(&self) -> Result<f64, ParseFloatError>
Parses the value as a double.
Sourcepub fn as_double_or(&self, default: f64) -> f64
pub fn as_double_or(&self, default: f64) -> f64
Gets the value as a double, or a default on parse failure.
Sourcepub fn as_bool(&self) -> Result<bool, &'static str>
pub fn as_bool(&self) -> Result<bool, &'static str>
Parses the value as a boolean.
Accepts: “T”, “TRUE” (true), “F”, “FALSE” (false)
Sourcepub fn as_bool_or(&self, default: bool) -> bool
pub fn as_bool_or(&self, default: bool) -> bool
Gets the value as a boolean, or a default on parse failure.
Sourcepub fn as_coord(&self) -> Result<Coord, AltiumError>
pub fn as_coord(&self) -> Result<Coord, AltiumError>
Parses the value as a Coord using unit suffix.
Sourcepub fn as_coord_or(&self, default: Coord) -> Coord
pub fn as_coord_or(&self, default: Coord) -> Coord
Gets the value as a Coord, or a default on parse failure.
Sourcepub fn as_color(&self) -> Result<Color, ParseIntError>
pub fn as_color(&self) -> Result<Color, ParseIntError>
Parses the value as a Color (Win32 COLORREF).
Sourcepub fn as_color_or(&self, default: Color) -> Color
pub fn as_color_or(&self, default: Color) -> Color
Gets the value as a Color, or a default on parse failure.
Sourcepub fn as_parameters(&self) -> ParameterCollection
pub fn as_parameters(&self) -> ParameterCollection
Parses the value as a nested ParameterCollection.
Sourcepub fn as_string_list(&self) -> Vec<String>
pub fn as_string_list(&self) -> Vec<String>
Splits the value by the list separator and returns string items.
Sourcepub fn as_int_list(&self) -> Vec<i32>
pub fn as_int_list(&self) -> Vec<i32>
Splits the value by the list separator and returns integer items.
Sourcepub fn as_double_list(&self) -> Vec<f64>
pub fn as_double_list(&self) -> Vec<f64>
Splits the value by the list separator and returns double items.
Sourcepub fn as_coord_list(&self) -> Vec<Coord>
pub fn as_coord_list(&self) -> Vec<Coord>
Splits the value by the list separator and returns Coord items.
Sourcepub fn is_parameters(&self) -> bool
pub fn is_parameters(&self) -> bool
Returns true if this value contains nested parameters.
Trait Implementations§
Source§impl Clone for ParameterValue
impl Clone for ParameterValue
Source§fn clone(&self) -> ParameterValue
fn clone(&self) -> ParameterValue
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ParameterValue
impl Debug for ParameterValue
Source§impl Default for ParameterValue
impl Default for ParameterValue
Source§fn default() -> ParameterValue
fn default() -> ParameterValue
Auto Trait Implementations§
impl Freeze for ParameterValue
impl RefUnwindSafe for ParameterValue
impl Send for ParameterValue
impl Sync for ParameterValue
impl Unpin for ParameterValue
impl UnwindSafe for ParameterValue
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
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>
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>
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