#[derive(GrpcError)]
{
// Attributes available to this derive:
#[grpc]
}
Expand description
Derives the GrpcError trait for an error enum.
§Attributes
#[grpc(internal)]- Marks a variant as an internal error (will map totonic::Code::Internal)
§Generated Code
This macro generates:
- A companion
*GrpcErrorenum with#[repr(u8)]for wire serialization - An implementation of the
GrpcErrortrait for the companion enum - A method
api_error()on the original enum that maps to the companion enum - An implementation of
From<Error> for tonic::Statusfor automatic error conversion