pub struct Error { /* private fields */ }
Expand description
An error with an enumerable kind and optional data.
Implementations§
source§impl Error
impl Error
sourcepub fn with<F>(kind: ErrorKind, f: F) -> Selfwhere
F: FnOnce(&mut Self),
pub fn with<F>(kind: ErrorKind, f: F) -> Selfwhere
F: FnOnce(&mut Self),
Creates a new error and allows instant modification in a function.
sourcepub fn invalid<S>(reason: S) -> Selfwhere
S: Display,
pub fn invalid<S>(reason: S) -> Selfwhere
S: Display,
Creates an invalid data error with a plain text reason.
sourcepub fn nonempty_string() -> Self
pub fn nonempty_string() -> Self
Creates an error that describes an expected non-empty string.
sourcepub fn data(&self) -> impl Iterator<Item = (&str, &Value)>
pub fn data(&self) -> impl Iterator<Item = (&str, &Value)>
Returns an iterator over the data of this error.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Error
impl<'de> Deserialize<'de> for Error
source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Error
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)