pub enum JoydbError {
Io(Error),
NotFile(PathBuf),
NotDirectory(PathBuf),
Serialize(Box<dyn Error + Send + Sync>),
Deserialize(Box<dyn Error + Send + Sync>),
DuplicatedId {
id: String,
model: String,
},
NotFound {
id: String,
model: String,
},
Custom(Box<dyn Error + Send + Sync>),
}Expand description
Joydb error type.
Variants§
Io(Error)
File system related error.
NotFile(PathBuf)
A path expected to be a file, but it is not.
NotDirectory(PathBuf)
A path expected to be a directory, but it is not.
Serialize(Box<dyn Error + Send + Sync>)
Serialization error. This may occur when adapter format is not supporting the data type. For example, if you try to serialize a HashMap with K type as a complex structure to JSON.
Deserialize(Box<dyn Error + Send + Sync>)
Deserialization error. May occur on opening a file.
DuplicatedId
Error when trying to insert a model with an ID that already exists.
NotFound
Error when trying to update a model with an ID that does not exist.
Custom(Box<dyn Error + Send + Sync>)
Custom error variant. Intended for third party adapters for situations when non of the existing variants are suitable.
Trait Implementations§
Source§impl Debug for JoydbError
impl Debug for JoydbError
Source§impl Display for JoydbError
impl Display for JoydbError
Source§impl Error for JoydbError
impl Error for JoydbError
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 JoydbError
impl !RefUnwindSafe for JoydbError
impl Send for JoydbError
impl Sync for JoydbError
impl Unpin for JoydbError
impl !UnwindSafe for JoydbError
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