pub struct ProblemDeserializer {
pub kind: &'static str,
pub from_json: ProblemFromJsonFn,
}Expand description
Pair of (kind, deserializer) used to power
problem_from_json. Each Problem impl that wants to be
reconstructable from JSON registers one of these via
inventory::submit!. The crate ships registrations for the
problem types we know how to round-trip; out-of-tree
Problem impls can register their own.
The register_problem_de! macro generates this entry from a
serde::Deserialize impl on the target struct.
Fields§
§kind: &'static strThe problem kind identifier (matches ProblemKindInfo.kind).
from_json: ProblemFromJsonFnFunction that takes the JSON details and produces a typed
Box<dyn Problem> (or a serde_json::Error if the shape
doesn’t match).
Trait Implementations§
impl Collect for ProblemDeserializer
Auto Trait Implementations§
impl Freeze for ProblemDeserializer
impl RefUnwindSafe for ProblemDeserializer
impl Send for ProblemDeserializer
impl Sync for ProblemDeserializer
impl Unpin for ProblemDeserializer
impl UnsafeUnpin for ProblemDeserializer
impl UnwindSafe for ProblemDeserializer
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> 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