pub enum SzConfigError {
JsonParse(String),
NotFound(String),
AlreadyExists(String),
InvalidInput(String),
MissingSection(String),
InvalidStructure(String),
MissingField(String),
InvalidConfig(String),
NotImplemented(String),
}Expand description
Custom error type for configuration operations
Variants§
JsonParse(String)
JSON parsing error
NotFound(String)
Item not found
AlreadyExists(String)
Item already exists
InvalidInput(String)
Invalid input
MissingSection(String)
Missing required section
InvalidStructure(String)
Invalid configuration structure
MissingField(String)
Missing required field
InvalidConfig(String)
Invalid configuration state
NotImplemented(String)
Not implemented
Implementations§
Source§impl SzConfigError
impl SzConfigError
Sourcepub fn json_parse<S: Into<String>>(msg: S) -> Self
pub fn json_parse<S: Into<String>>(msg: S) -> Self
Create a JSON parse error
Sourcepub fn already_exists<S: Into<String>>(msg: S) -> Self
pub fn already_exists<S: Into<String>>(msg: S) -> Self
Create an already exists error
Sourcepub fn validation<S: Into<String>>(msg: S) -> Self
pub fn validation<S: Into<String>>(msg: S) -> Self
Create an invalid input error (validation)
Sourcepub fn not_implemented<S: Into<String>>(msg: S) -> Self
pub fn not_implemented<S: Into<String>>(msg: S) -> Self
Create a not implemented error
Trait Implementations§
Source§impl Debug for SzConfigError
impl Debug for SzConfigError
Source§impl Display for SzConfigError
impl Display for SzConfigError
Source§impl Error for SzConfigError
impl Error for SzConfigError
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()
Auto Trait Implementations§
impl Freeze for SzConfigError
impl RefUnwindSafe for SzConfigError
impl Send for SzConfigError
impl Sync for SzConfigError
impl Unpin for SzConfigError
impl UnsafeUnpin for SzConfigError
impl UnwindSafe for SzConfigError
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