pub struct ErrorWithMessage {
pub error: String,
pub message: String,
}Expand description
Error body with a message: { "error": "...", "message": "..." }.
Used for JSON parse errors that include a description of what went wrong.
Fields§
§error: String§message: StringImplementations§
Source§impl ErrorWithMessage
impl ErrorWithMessage
Sourcepub fn parse<__VldInputT: VldInput + ?Sized>(
input: &__VldInputT,
) -> Result<ErrorWithMessage, VldError>
pub fn parse<__VldInputT: VldInput + ?Sized>( input: &__VldInputT, ) -> Result<ErrorWithMessage, VldError>
Parse and validate input data into this struct.
Accepts any type implementing [VldInput]: JSON strings, file paths,
serde_json::Value, byte slices, etc.
Sourcepub fn parse_value(__vld_json: &Value) -> Result<ErrorWithMessage, VldError>
pub fn parse_value(__vld_json: &Value) -> Result<ErrorWithMessage, VldError>
Parse and validate directly from a serde_json::Value.
Trait Implementations§
Source§impl Clone for ErrorWithMessage
impl Clone for ErrorWithMessage
Source§fn clone(&self) -> ErrorWithMessage
fn clone(&self) -> ErrorWithMessage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ErrorWithMessage
impl Debug for ErrorWithMessage
Source§impl Serialize for ErrorWithMessage
impl Serialize for ErrorWithMessage
Source§impl VldParse for ErrorWithMessage
impl VldParse for ErrorWithMessage
Auto Trait Implementations§
impl Freeze for ErrorWithMessage
impl RefUnwindSafe for ErrorWithMessage
impl Send for ErrorWithMessage
impl Sync for ErrorWithMessage
impl Unpin for ErrorWithMessage
impl UnwindSafe for ErrorWithMessage
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