pub enum ParameterValue {
NotSet,
Bool(bool),
Integer(i64),
Double(f64),
String(String<nros_params::::types::ParameterValue::{constant#0}>),
ByteArray(Vec<u8, nros_params::::types::ParameterValue::{constant#1}>),
BoolArray(Vec<bool, nros_params::::types::ParameterValue::{constant#2}>),
IntegerArray(Vec<i64, nros_params::::types::ParameterValue::{constant#3}>),
DoubleArray(Vec<f64, nros_params::::types::ParameterValue::{constant#4}>),
StringArray(Vec<String<nros_params::::types::ParameterValue::{constant#5}>, nros_params::::types::ParameterValue::{constant#6}>),
}Expand description
Parameter value container
Holds a parameter value of any supported type. Note: This enum is intentionally large to support all parameter types without heap allocation in embedded systems.
Variants§
NotSet
Value not set
Bool(bool)
Boolean value
Integer(i64)
64-bit signed integer value
Double(f64)
64-bit floating point value
String(String<nros_params::::types::ParameterValue::{constant#0}>)
String value
ByteArray(Vec<u8, nros_params::::types::ParameterValue::{constant#1}>)
Byte array value
BoolArray(Vec<bool, nros_params::::types::ParameterValue::{constant#2}>)
Boolean array value
IntegerArray(Vec<i64, nros_params::::types::ParameterValue::{constant#3}>)
Integer array value
DoubleArray(Vec<f64, nros_params::::types::ParameterValue::{constant#4}>)
Double array value
StringArray(Vec<String<nros_params::::types::ParameterValue::{constant#5}>, nros_params::::types::ParameterValue::{constant#6}>)
String array value (array of fixed-size strings)
Implementations§
Source§impl ParameterValue
impl ParameterValue
Sourcepub fn param_type(&self) -> ParameterType
pub fn param_type(&self) -> ParameterType
Get the parameter type for this value
Sourcepub fn as_integer(&self) -> Option<i64>
pub fn as_integer(&self) -> Option<i64>
Try to get the value as an integer
Sourcepub fn as_byte_array(&self) -> Option<&[u8]>
pub fn as_byte_array(&self) -> Option<&[u8]>
Try to get the value as a byte array slice
Sourcepub fn as_bool_array(&self) -> Option<&[bool]>
pub fn as_bool_array(&self) -> Option<&[bool]>
Try to get the value as a bool array slice
Sourcepub fn as_integer_array(&self) -> Option<&[i64]>
pub fn as_integer_array(&self) -> Option<&[i64]>
Try to get the value as an integer array slice
Sourcepub fn as_double_array(&self) -> Option<&[f64]>
pub fn as_double_array(&self) -> Option<&[f64]>
Try to get the value as a double array slice
Sourcepub fn from_bool(value: bool) -> ParameterValue
pub fn from_bool(value: bool) -> ParameterValue
Create a bool value
Sourcepub fn from_integer(value: i64) -> ParameterValue
pub fn from_integer(value: i64) -> ParameterValue
Create an integer value
Sourcepub fn from_double(value: f64) -> ParameterValue
pub fn from_double(value: f64) -> ParameterValue
Create a double value
Sourcepub fn from_string(value: &str) -> Option<ParameterValue>
pub fn from_string(value: &str) -> Option<ParameterValue>
Create a string value from a str slice
Trait Implementations§
Source§impl Clone for ParameterValue
impl Clone for ParameterValue
Source§fn clone(&self) -> ParameterValue
fn clone(&self) -> ParameterValue
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ParameterValue
impl RefUnwindSafe for ParameterValue
impl Send for ParameterValue
impl Sync for ParameterValue
impl Unpin for ParameterValue
impl UnsafeUnpin 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
Mutably borrows from an owned value. Read more