amq-rpc 0.1.0

RabbitMQ RPC library
Documentation
use thiserror::Error;

pub type RpcResult<T> = Result<T, RpcError>;

#[derive(Error, Debug)]
pub enum RpcError {
    #[error("Connection error: {0}")]
    Connection(#[from] lapin::Error),

    #[error("Command timeout")]
    Timeout,

    #[error("Command cancelled")]
    Cancelled,

    #[error("Command interrupted")]
    Interrupted,

    #[error("Serialization error: {0}")]
    Serialization(#[from] serde_json::Error),

    #[error("Invalid command: {message}")]
    InvalidCommand { message: String },

    #[error("Server error: {message}")]
    ServerError { message: String },
}