Type Alias BoxError

Source
pub type BoxError = Box<dyn Error + Send + Sync + 'static>;
Expand description

Generic thread-safe boxed error.

From all our prior experience we’ve learned that there is very little practical use in concrete error types. On the surface it seems appealing to use such errors, because they have, ahem, concrete type. But the flip side is that code in big projects quickly ends up being polluted with endless adapter error types to combine different APIs together, or, even worse, an Error god-object gets introduced to accommodate all possible error types.

On rare occasions concrete error types can be used, where handling of the error depends on the error kind. But, in practice, such cases are quite rare.

Aliased Type§

pub struct BoxError(/* private fields */);