pub enum NoteError {
MissingField(String),
UnknownField(String),
EmptyField(String),
EmptyQuestion,
InvalidMedia(String),
DuplicateNote,
ValidationError(String),
FieldValidationError {
field: String,
message: String,
},
AnkiError(AnkiError),
}
Expand description
Errors that can occur when creating or manipulating notes
Variants§
MissingField(String)
A required field was missing from the note
UnknownField(String)
An unknown field was provided
EmptyField(String)
A field was provided with empty content
EmptyQuestion
Field content would make an empty question
InvalidMedia(String)
Media file is missing or invalid
DuplicateNote
The note would be a duplicate
ValidationError(String)
Other validation error
FieldValidationError
Field content validation error
AnkiError(AnkiError)
Conversion from AnkiError
Trait Implementations§
Source§impl Error for NoteError
impl Error for NoteError
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<AnkiConnectError> for NoteError
impl From<AnkiConnectError> for NoteError
Source§fn from(err: AnkiConnectError) -> Self
fn from(err: AnkiConnectError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for NoteError
impl !RefUnwindSafe for NoteError
impl Send for NoteError
impl Sync for NoteError
impl Unpin for NoteError
impl !UnwindSafe for NoteError
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