Crate rocketmq_error

Crate rocketmq_error 

Source
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 From trait
  • 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§

client_broker_err
mq_client_err_legacyDeprecated
request_timeout_err

Structs§

ClientErr
MQBrokerErr
RequestTimeoutErr

Enums§

LegacyServiceErrorDeprecated
Service error enumeration (LEGACY - deprecated)
RocketmqError

Type Aliases§

LegacyResultDeprecated
LegacyRocketMQResultDeprecated