Struct Status
pub struct Status {
pub code: i32,
pub message: String,
pub details: Vec<Any>,
}Expand description
The Status type defines a logical error model that is suitable for
different programming environments, including REST APIs and RPC APIs. It is
used by gRPC. Each Status message contains
three pieces of data: error code, error message, and error details.
You can find out more about this error model and how to work with it in the API Design Guide.
Fields§
§code: i32The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
message: StringA developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
details: Vec<Any>A list of messages that carry the error details. There is a common set of message types for APIs to use.
Trait Implementations§
§impl Message for Status
impl Message for Status
§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.§impl RpcStatusExt for Status
impl RpcStatusExt for Status
§fn check_error_details(&self) -> Result<ErrorDetails, DecodeError>
fn check_error_details(&self) -> Result<ErrorDetails, DecodeError>
pb::Status
are malformed or not. Tries to get an ErrorDetails struct from a
pb::Status. If some prost::DecodeError occurs, it will be
returned. If not debugging, consider using
RpcStatusExt::get_error_details or
RpcStatusExt::get_error_details_vec.§fn get_error_details(&self) -> ErrorDetails
fn get_error_details(&self) -> ErrorDetails
ErrorDetails struct from pb::Status. If some
prost::DecodeError occurs, an empty ErrorDetails struct will be
returned.§fn check_error_details_vec(&self) -> Result<Vec<ErrorDetail>, DecodeError>
fn check_error_details_vec(&self) -> Result<Vec<ErrorDetail>, DecodeError>
pb::Status
are malformed or not. Tries to get a vector of ErrorDetail enums
from a pb::Status. If some prost::DecodeError occurs, it will be
returned. If not debugging, consider using
StatusExt::get_error_details_vec or
StatusExt::get_error_details.§fn get_error_details_vec(&self) -> Vec<ErrorDetail>
fn get_error_details_vec(&self) -> Vec<ErrorDetail>
ErrorDetail enums from pb::Status. If some
prost::DecodeError occurs, an empty vector will be returned.§fn get_details_retry_info(&self) -> Option<RetryInfo>
fn get_details_retry_info(&self) -> Option<RetryInfo>
RetryInfo details found on pb::Status, if any. If
some prost::DecodeError occurs, returns None.§fn get_details_debug_info(&self) -> Option<DebugInfo>
fn get_details_debug_info(&self) -> Option<DebugInfo>
DebugInfo details found on pb::Status, if any. If
some prost::DecodeError occurs, returns None.§fn get_details_quota_failure(&self) -> Option<QuotaFailure>
fn get_details_quota_failure(&self) -> Option<QuotaFailure>
QuotaFailure details found on pb::Status, if any.
If some prost::DecodeError occurs, returns None.§fn get_details_error_info(&self) -> Option<ErrorInfo>
fn get_details_error_info(&self) -> Option<ErrorInfo>
ErrorInfo details found on pb::Status, if any. If
some prost::DecodeError occurs, returns None.§fn get_details_precondition_failure(&self) -> Option<PreconditionFailure>
fn get_details_precondition_failure(&self) -> Option<PreconditionFailure>
PreconditionFailure details found on pb::Status,
if any. If some prost::DecodeError occurs, returns None.§fn get_details_bad_request(&self) -> Option<BadRequest>
fn get_details_bad_request(&self) -> Option<BadRequest>
BadRequest details found on pb::Status, if any. If
some prost::DecodeError occurs, returns None.§fn get_details_request_info(&self) -> Option<RequestInfo>
fn get_details_request_info(&self) -> Option<RequestInfo>
RequestInfo details found on pb::Status, if any.
If some prost::DecodeError occurs, returns None.§fn get_details_resource_info(&self) -> Option<ResourceInfo>
fn get_details_resource_info(&self) -> Option<ResourceInfo>
ResourceInfo details found on pb::Status, if any.
If some prost::DecodeError occurs, returns None.§fn get_details_help(&self) -> Option<Help>
fn get_details_help(&self) -> Option<Help>
Help details found on pb::Status, if any. If some
prost::DecodeError occurs, returns None.§fn get_details_localized_message(&self) -> Option<LocalizedMessage>
fn get_details_localized_message(&self) -> Option<LocalizedMessage>
LocalizedMessage details found on pb::Status, if
any. If some prost::DecodeError occurs, returns None.impl StructuralPartialEq for Status
Auto Trait Implementations§
impl Freeze for Status
impl RefUnwindSafe for Status
impl Send for Status
impl Sync for Status
impl Unpin for Status
impl UnwindSafe for Status
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more