pub enum Error {
ParseError {
message: String,
},
FileError {
message: String,
},
TypeError {
message: String,
},
KeyNotFound {
key: String,
},
SectionNotFound {
name: String,
},
}Expand description
Error types that can occur during YINI parsing and operations.
Variants§
ParseError
Error that occurs during parsing of YINI content (equivalent to yini::ParseError).
FileError
Error that occurs during file I/O operations (equivalent to yini::FileError).
TypeError
Error that occurs when trying to access a value with wrong type.
KeyNotFound
Error that occurs when trying to access a non-existent key or section.
SectionNotFound
Error that occurs when trying to access a non-existent section.
Implementations§
Source§impl Error
impl Error
Sourcepub fn parse_error(message: impl Into<String>) -> Self
pub fn parse_error(message: impl Into<String>) -> Self
Create a new parse error (matches yini::ParseError).
Sourcepub fn file_error(message: impl Into<String>) -> Self
pub fn file_error(message: impl Into<String>) -> Self
Create a new file error (matches yini::FileError).
Sourcepub fn type_error(message: impl Into<String>) -> Self
pub fn type_error(message: impl Into<String>) -> Self
Create a new type conversion error.
Sourcepub fn key_not_found(key: impl Into<String>) -> Self
pub fn key_not_found(key: impl Into<String>) -> Self
Create a new key not found error.
Sourcepub fn section_not_found(name: impl Into<String>) -> Self
pub fn section_not_found(name: impl Into<String>) -> Self
Create a new section not found error.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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 Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
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