Enum tonic::Code [−][src]
pub enum Code {
Show 17 variants
Ok,
Cancelled,
Unknown,
InvalidArgument,
DeadlineExceeded,
NotFound,
AlreadyExists,
PermissionDenied,
ResourceExhausted,
FailedPrecondition,
Aborted,
OutOfRange,
Unimplemented,
Internal,
Unavailable,
DataLoss,
Unauthenticated,
}
Expand description
gRPC status codes used by Status
.
These variants match the gRPC status codes.
Variants
The operation completed successfully.
The operation was cancelled.
Unknown error.
Client specified an invalid argument.
Deadline expired before operation could complete.
Some requested entity was not found.
Some entity that we attempted to create already exists.
The caller does not have permission to execute the specified operation.
Some resource has been exhausted.
The system is not in a state required for the operation’s execution.
The operation was aborted.
Operation was attempted past the valid range.
Operation is not implemented or not supported.
Internal error.
The service is currently unavailable.
Unrecoverable data loss or corruption.
The request does not have valid authentication credentials
Implementations
Get description of this Code
.
fn make_grpc_request() -> tonic::Code {
// ...
tonic::Code::Ok
}
let code = make_grpc_request();
println!("Operation completed. Human readable description: {}", code.description());
If you only need description in println
, format
, log
and other
formatting contexts, you may want to use Display
impl for Code
instead.
Get the Code
that represents the integer, if known.
If not known, returns Code::Unknown
(surprise!).
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Code
impl UnwindSafe for Code
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more