cdumay_core
cdumay_core is a lightweight crate that provides custom Error and Result types
as drop-in replacements for Rust’s standard std::result::Result and std::error::Error,
with the primary goal of supporting serialization and deserialization via [serde].
Motivation
Rust's standard error types do not implement Serialize and Deserialize due to
their generic and trait-based nature. This crate provides concrete, serializable
alternatives suitable for applications like:
- Returning structured errors from APIs (e.g., HTTP, RPC, WebAssembly)
- Communicating errors across process boundaries
Features
- [
Error] — A serializable error type with a message and optional cause. - [
Result<T>] — A simple alias forcrate::result::Result<T, Error>, fully serializable. - Full support for
serde::{Serialize, Deserialize}. - Optional integration with external crates via feature flags.
Example
use ;
Optional Features
utoipa: Implementutoipa::ToSchematoErroractix-web: Allow to useResultandErrorwith actix
Compatibility
This crate is designed for applications that require custom serialization logic.
It is not a full replacement for std::result::Result in all use cases, especially
where standard error traits are expected.
Macros
Use the provided derive macros to define your error and error kind structs:
use ;
define_kinds!
define_errors!