pub struct JsonErrorConverter;Expand description
A utility struct for handling JSON errors and converting them into standardized error types.
Trait Implementations§
Source§impl ErrorConverter for JsonErrorConverter
impl ErrorConverter for JsonErrorConverter
Source§fn convert(err: &Error, text: String, context: BTreeMap<String, Value>) -> Error
fn convert(err: &Error, text: String, context: BTreeMap<String, Value>) -> Error
Converts a serde_json::Error into a standardized Error type based on its category.
§Arguments
err- Theserde_json::Errorto be converted.text- A descriptive message for the error.context- A mutable reference to aBTreeMapcontaining additional error details.
§Returns
A standardized Error instance corresponding to the category of the provided serde_json::Error.
Auto Trait Implementations§
impl Freeze for JsonErrorConverter
impl RefUnwindSafe for JsonErrorConverter
impl Send for JsonErrorConverter
impl Sync for JsonErrorConverter
impl Unpin for JsonErrorConverter
impl UnwindSafe for JsonErrorConverter
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