pub struct ParameterDescriptor {
pub name: String<MAX_PARAM_NAME_LEN>,
pub param_type: ParameterType,
pub description: String<MAX_STRING_VALUE_LEN>,
pub read_only: bool,
pub dynamic_typing: bool,
pub range: ParameterRange,
}Expand description
Parameter descriptor containing metadata
Describes a parameter including its type, constraints, and documentation.
Fields§
§name: String<MAX_PARAM_NAME_LEN>Parameter name
param_type: ParameterTypeParameter type
description: String<MAX_STRING_VALUE_LEN>Human-readable description
read_only: boolWhether the parameter is read-only
dynamic_typing: boolWhether the parameter type can change dynamically
range: ParameterRangeRange constraints
Implementations§
Source§impl ParameterDescriptor
impl ParameterDescriptor
Sourcepub fn new(name: &str, param_type: ParameterType) -> Option<Self>
pub fn new(name: &str, param_type: ParameterType) -> Option<Self>
Create a new parameter descriptor
Sourcepub fn with_description(self, desc: &str) -> Self
pub fn with_description(self, desc: &str) -> Self
Set the description
Sourcepub fn with_read_only(self, read_only: bool) -> Self
pub fn with_read_only(self, read_only: bool) -> Self
Set read-only flag
Sourcepub fn with_dynamic_typing(self, dynamic: bool) -> Self
pub fn with_dynamic_typing(self, dynamic: bool) -> Self
Set dynamic typing flag
Sourcepub fn with_integer_range(self, min: i64, max: i64, step: i64) -> Self
pub fn with_integer_range(self, min: i64, max: i64, step: i64) -> Self
Set integer range constraints
Sourcepub fn with_float_range(self, min: f64, max: f64, step: f64) -> Self
pub fn with_float_range(self, min: f64, max: f64, step: f64) -> Self
Set floating point range constraints
Sourcepub fn validate_range(&self, value: &ParameterValue) -> bool
pub fn validate_range(&self, value: &ParameterValue) -> bool
Check if a value satisfies the range constraints
Trait Implementations§
Source§impl Clone for ParameterDescriptor
impl Clone for ParameterDescriptor
Source§fn clone(&self) -> ParameterDescriptor
fn clone(&self) -> ParameterDescriptor
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 moreAuto Trait Implementations§
impl Freeze for ParameterDescriptor
impl RefUnwindSafe for ParameterDescriptor
impl Send for ParameterDescriptor
impl Sync for ParameterDescriptor
impl Unpin for ParameterDescriptor
impl UnsafeUnpin for ParameterDescriptor
impl UnwindSafe for ParameterDescriptor
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