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 not_found(name: impl Into<String>) -> ParameterError
pub fn not_found(name: impl Into<String>) -> ParameterError
Create a new not found error
Sourcepub fn type_mismatch(expected: ParamType, got: ParamType) -> ParameterError
pub fn type_mismatch(expected: ParamType, got: ParamType) -> ParameterError
Create a new type mismatch error
Sourcepub fn out_of_range(value: f32, min: f32, max: f32) -> ParameterError
pub fn out_of_range(value: f32, min: f32, max: f32) -> ParameterError
Create a new out of range error
Sourcepub fn invalid_choice(choice: impl Into<String>) -> ParameterError
pub fn invalid_choice(choice: impl Into<String>) -> ParameterError
Create a new invalid choice error
Sourcepub fn duplicate(name: impl Into<String>) -> ParameterError
pub fn duplicate(name: impl Into<String>) -> ParameterError
Create a new duplicate parameter error
Sourcepub fn read_only(name: impl Into<String>) -> ParameterError
pub fn read_only(name: impl Into<String>) -> ParameterError
Create a new read-only 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 (const: unstable) · 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) -> ProcessError
fn from(err: ParameterError) -> ProcessError
Converts to this type from the input type.
Source§impl PartialEq for ParameterError
impl PartialEq for ParameterError
Source§fn eq(&self, other: &ParameterError) -> bool
fn eq(&self, other: &ParameterError) -> bool
Tests for
self and other values to be equal, and is used by ==.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