Trait InspectError

Source
pub trait InspectError {
    // Required method
    fn inspect_error(error: impl Error);
}
Expand description

A trait to inspect skipped deserialization errors

The VecSkipError and MapSkipError adapters allow to skip values which fail to deserialize. This trait allows inspecting these errors, for example for logging purposes.

The trait has a single method inspect_error, which will be called for each deserialization error. The default implementation for () does nothing.

See the documentation of VecSkipError and MapSkipError for usage examples.

Required Methods§

Source

fn inspect_error(error: impl Error)

Inspect a deserialization error which was skipped.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl InspectError for ()

Source§

fn inspect_error(_error: impl Error)

Implementors§