pub enum ParameterError {
Empty,
InvalidCharacter(char),
TooLong {
max: usize,
},
MustStartWithLetter,
NotFound(String),
TypeMismatch {
expected: ParamType,
got: ParamType,
},
OutOfRange {
value: f32,
min: f32,
max: f32,
},
InvalidChoice(String),
Duplicate(String),
ReadOnly(String),
}Expand description
Errors that can occur during parameter operations
Variants§
Empty
Parameter name is empty
InvalidCharacter(char)
Parameter name contains invalid character
TooLong
Parameter name is too long
MustStartWithLetter
Parameter name must start with a letter
NotFound(String)
Parameter not found
TypeMismatch
Parameter type mismatch
OutOfRange
Value out of range
Fields
InvalidChoice(String)
Invalid choice (for Choice parameters)
Duplicate(String)
Duplicate parameter
ReadOnly(String)
Parameter is read-only
Implementations§
Source§impl ParameterError
impl ParameterError
Sourcepub fn type_mismatch(expected: ParamType, got: ParamType) -> Self
pub fn type_mismatch(expected: ParamType, got: ParamType) -> Self
Create a new type mismatch error
Sourcepub fn out_of_range(value: f32, min: f32, max: f32) -> Self
pub fn out_of_range(value: f32, min: f32, max: f32) -> Self
Create a new out of range error
Sourcepub fn invalid_choice(choice: impl Into<String>) -> Self
pub fn invalid_choice(choice: impl Into<String>) -> Self
Create a new invalid choice error
Trait Implementations§
Source§impl Clone for ParameterError
impl Clone for ParameterError
Source§fn clone(&self) -> ParameterError
fn clone(&self) -> ParameterError
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 ParameterError
impl Debug for ParameterError
Source§impl Display for ParameterError
impl Display for ParameterError
Source§impl Error for ParameterError
impl Error for ParameterError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<ParameterError> for ProcessError
impl From<ParameterError> for ProcessError
Source§fn from(err: ParameterError) -> Self
fn from(err: ParameterError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ParameterError
impl PartialEq for ParameterError
impl StructuralPartialEq for ParameterError
Auto Trait Implementations§
impl Freeze for ParameterError
impl RefUnwindSafe for ParameterError
impl Send for ParameterError
impl Sync for ParameterError
impl Unpin for ParameterError
impl UnsafeUnpin for ParameterError
impl UnwindSafe for ParameterError
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