Enum tonic::Code [−][src]
pub enum Code { Ok, Cancelled, Unknown, InvalidArgument, DeadlineExceeded, NotFound, AlreadyExists, PermissionDenied, ResourceExhausted, FailedPrecondition, Aborted, OutOfRange, Unimplemented, Internal, Unavailable, DataLoss, Unauthenticated, // some variants omitted }
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
impl Code
[src][−]
pub fn description(&self) -> &'static str
[src][−]
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.
impl Code
[src][−]
pub fn from_i32(i: i32) -> Code
[src][−]
Get the Code
that represents the integer, if known.
If not known, returns Code::Unknown
(surprise!).
Trait Implementations
impl Clone for Code
[src][+]
impl Copy for Code
[src]
impl Debug for Code
[src][+]
impl Display for Code
[src][+]
impl Eq for Code
[src]
impl From<i32> for Code
[src][+]
impl PartialEq<Code> for Code
[src][+]
impl StructuralEq for Code
[src]
impl StructuralPartialEq for Code
[src]
Auto Trait Implementations
impl RefUnwindSafe for Code
impl Send for Code
impl Sync for Code
impl Unpin for Code
impl UnwindSafe for Code
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src][+]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
impl<T> From<T> for T
[src][+]
impl<T> Instrument for T
[src][+]
impl<T> Instrument for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T> Pointable for T
[src][+]
impl<T> ToOwned for T where
T: Clone,
[src][+]
T: Clone,
impl<T> ToString for T where
T: Display + ?Sized,
[src][+]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src][+]
V: MultiLane<T>,