Struct JsonCtx
pub struct JsonCtx<'a, E> { /* private fields */ }Expand description
Combines an error with a json value that serves as context.
Typically, this json context is the input the function, that produced the error, received.
Implementations§
§impl<'a, E> JsonCtx<'a, E>
impl<'a, E> JsonCtx<'a, E>
pub fn inner_error(&self) -> &E
pub fn inner_error(&self) -> &E
The wrapped error
pub fn json_ctx(&self) -> &Value
pub fn json_ctx(&self) -> &Value
The json value that is related to the error. Normally, this will be the input to the function that produced the error.
pub fn into_inner(self) -> (E, &'a Value)
pub fn into_inner(self) -> (E, &'a Value)
This consumes the JsonCtx and returns its parts as tuple
so that they can be used further.
Trait Implementations§
§impl<'a> From<JsonCtx<'a, TargetDataError<ListKind>>> for TargetError<'a>
impl<'a> From<JsonCtx<'a, TargetDataError<ListKind>>> for TargetError<'a>
§fn from(value: JsonCtx<'a, TargetDataError<ListKind>>) -> TargetError<'a>
fn from(value: JsonCtx<'a, TargetDataError<ListKind>>) -> TargetError<'a>
Converts to this type from the input type.
§impl<'a> From<JsonCtx<'a, TargetDataError<VariableKind>>> for TargetError<'a>
impl<'a> From<JsonCtx<'a, TargetDataError<VariableKind>>> for TargetError<'a>
§fn from(value: JsonCtx<'a, TargetDataError<VariableKind>>) -> TargetError<'a>
fn from(value: JsonCtx<'a, TargetDataError<VariableKind>>) -> TargetError<'a>
Converts to this type from the input type.
§impl<'a> From<JsonCtx<'a, TargetError<'a>>> for ModelError<'a>
impl<'a> From<JsonCtx<'a, TargetError<'a>>> for ModelError<'a>
§fn from(value: JsonCtx<'a, TargetError<'a>>) -> ModelError<'a>
fn from(value: JsonCtx<'a, TargetError<'a>>) -> ModelError<'a>
Converts to this type from the input type.
impl<'a, E> StructuralPartialEq for JsonCtx<'a, E>where
E: PartialEq,
Auto Trait Implementations§
impl<'a, E> Freeze for JsonCtx<'a, E>where
E: Freeze,
impl<'a, E> RefUnwindSafe for JsonCtx<'a, E>where
E: RefUnwindSafe,
impl<'a, E> Send for JsonCtx<'a, E>where
E: Send,
impl<'a, E> Sync for JsonCtx<'a, E>where
E: Sync,
impl<'a, E> Unpin for JsonCtx<'a, E>where
E: Unpin,
impl<'a, E> UnsafeUnpin for JsonCtx<'a, E>where
E: UnsafeUnpin,
impl<'a, E> UnwindSafe for JsonCtx<'a, E>where
E: UnwindSafe,
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§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more