pub struct GrpcCode {
pub name: &'static str,
pub value: i32,
}Expand description
gRPC status metadata used in RFC7807 payloads and tonic mapping.
The value matches the discriminant of tonic::Code, allowing direct
conversion when the tonic feature is enabled.
§Examples
use masterror::{AppCode, mapping_for_code};
let grpc = mapping_for_code(&AppCode::Internal).grpc();
assert_eq!(grpc.name, "INTERNAL");
assert_eq!(grpc.value, 13);Fields§
§name: &'static strCanonical name (e.g. "NOT_FOUND").
value: i32Numeric discriminant matching tonic::Code.
Trait Implementations§
impl Copy for GrpcCode
impl Eq for GrpcCode
impl StructuralPartialEq for GrpcCode
Auto Trait Implementations§
impl Freeze for GrpcCode
impl RefUnwindSafe for GrpcCode
impl Send for GrpcCode
impl Sync for GrpcCode
impl Unpin for GrpcCode
impl UnwindSafe for GrpcCode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more