pub enum Parameter {
Integer(i64),
Real(f64),
Boolean(bool),
String(String),
Array(Vec<Parameter>),
Object(HashMap<String, Parameter>),
}Expand description
Generic parameter value used in API requests and configuration.
This enum represents various data types that can be passed as parameters to EdgeFirst Studio API calls or stored in configuration files.
§Examples
use edgefirst_client::Parameter;
use std::collections::HashMap;
// Different parameter types
let int_param = Parameter::Integer(42);
let float_param = Parameter::Real(3.14);
let bool_param = Parameter::Boolean(true);
let string_param = Parameter::String("model_name".to_string());
// Complex nested parameters
let array_param = Parameter::Array(vec![
Parameter::Integer(1),
Parameter::Integer(2),
Parameter::Integer(3),
]);
let mut config = HashMap::new();
config.insert("learning_rate".to_string(), Parameter::Real(0.001));
config.insert("epochs".to_string(), Parameter::Integer(100));
let object_param = Parameter::Object(config);Variants§
Integer(i64)
64-bit signed integer value.
Real(f64)
64-bit floating-point value.
Boolean(bool)
Boolean true/false value.
String(String)
UTF-8 string value.
Array(Vec<Parameter>)
Array of nested parameter values.
Object(HashMap<String, Parameter>)
Object/map with string keys and parameter values.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Parameter
impl<'de> Deserialize<'de> for Parameter
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Parameter
Auto Trait Implementations§
impl Freeze for Parameter
impl RefUnwindSafe for Parameter
impl Send for Parameter
impl Sync for Parameter
impl Unpin for Parameter
impl UnwindSafe for Parameter
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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