pub fn core_to_composable<E>(error: E) -> ComposableError<E>Expand description
Converts a regular error type E to a ComposableError<E>.
This wraps a simple error in a ComposableError structure, allowing for future context addition and error composition.
§Note
For more idiomatic Rust code, consider using .into() instead:
use rustica::error::ComposableError;
let composable: ComposableError<_> = "error".into();§Type Parameters
E: The core error type
§Arguments
error: The error to wrap
§Examples
use rustica::error::{ComposableError, core_to_composable};
let simple_error = "file not found";
let composable = core_to_composable(simple_error);
assert_eq!(composable.core_error(), &"file not found");
assert!(composable.context().is_empty());