Struct Subspace :: sus :: error :: DynError

struct DynError
{ ... };

A type-erased Error object.

DynError also satisfies Error itself.

Using this allows the error type to be placed in heap-allocated smart pointers without templates, and thus without knowing the concrete type. For example a void foo(Box<DynError>) function can work with any Error type but does not need to be templated. This allows the function to be virtual, to reduce complilation time/binary size, or to provide dynamically linked library ABI.

Since it is type erased, it must only be referred to by reference/pointer, and it can not be moved similar to Pin<T> types in Rust.

See DynConcept for more on type erasure of concept-satisfying types.

Methods

auto display() const -> std::string
virtual

Forwards to the Error implementation of E.

auto source() const -> Option<const DynError&>
virtual

Forwards to the Error implementation of E.