Expand description
§RocketMQ Error Handling System
This crate provides a unified, semantic, and performant error handling system for the RocketMQ Rust implementation.
§New Unified Error System (v0.7.0+)
The new error system provides:
- Semantic clarity: Each error type clearly expresses what went wrong
- Performance: Minimal heap allocations, optimized for hot paths
- Ergonomics: Automatic error conversions via
Fromtrait - Debuggability: Rich context for production debugging
§Usage
use rocketmq_error::RocketMQError;
use rocketmq_error::RocketMQResult;
fn send_message(addr: &str) -> RocketMQResult<()> {
if addr.is_empty() {
return Err(RocketMQError::network_connection_failed(
"localhost:9876",
"invalid address",
));
}
Ok(())
}§Legacy Error System (Deprecated)
The legacy RocketmqError enum is still available for backward compatibility
but will be removed in a future version. Please migrate to the new unified system.
Re-exports§
pub use unified::NetworkError;pub use unified::ProtocolError;pub use unified::RocketMQError;pub use unified::SerializationError;pub use unified::ServiceError as UnifiedServiceError;pub use unified::ToolsError;pub use unified::Result;pub use unified::RocketMQResult;
Modules§
- unified
- Unified error system for RocketMQ Rust implementation
Macros§
Structs§
Enums§
- Legacy
Service Error Deprecated - Service error enumeration (LEGACY - deprecated)
- Rocketmq
Error
Type Aliases§
- Legacy
Result Deprecated - Legacy
RocketMQ Result Deprecated