aerro 0.2.1

Cross-service gRPC error framework for Rust.
Documentation
//! Handler traits for wrapping typed errors into `tonic::Status`.

/// The logic trait: implement this on your handler struct with the RPC business logic.
pub trait Handler {
    type Request: Send + 'static;
    type Response: Send + 'static;
    type Error: crate::Aerro;

    fn handle(
        &self,
        req: Self::Request,
    ) -> impl std::future::Future<Output = Result<Self::Response, Self::Error>> + Send;
}

/// The metadata trait: generated by `#[derive(aerro::AerroHandler)]` on a struct.
///
/// Requires [`Handler`] as a supertrait. The derive also generates an inherent
/// `call_tonic` method that converts the typed error into `tonic::Status`.
pub trait AerroHandler: Handler {
    const SERVICE: &'static str;
    const RPC: &'static str;
    const EXPOSURE: crate::Exposure;
    const MAX_FRAMES: u8;
}