Trait router_error::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§
sourcefn downcast_for_test<E: Explain>(&self) -> &E
fn downcast_for_test<E: Explain>(&self) -> &E
For tests only. Downcast the erased error to E
or panic if fails.
Object Safety§
This trait is not object safe.