pub(crate) trait IntoError {
// Required method
fn into_error(self) -> Error;
}
Expand description
A simple trait to encapsulate automatic conversion to Error
.
This trait basically exists to make Error::context
work without needing
to rely on public From
impls. For example, without this trait, we might
otherwise write impl From<String> for Error
. But this would make it part
of the public API. Which… maybe we should do, but at time of writing,
I’m starting very conservative so that we can evolve errors in semver
compatible ways.