router_error

Trait DowncastErrorForTest

Source
pub trait DowncastErrorForTest {
    // Required method
    fn downcast_for_test<E: Explain>(&self) -> &E;
}
Expand description

To test the error case of e.g. a Router implementation, it will be helpful to cast the erased error back to an expected error type and match on it.

Do not use this in production as conditioning behavior on error cases is extremely fragile.

Required Methods§

Source

fn downcast_for_test<E: Explain>(&self) -> &E

For tests only. Downcast the erased error to E or panic if fails.

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.

Implementors§