pub trait RpcStatusExt: Sealed {
Show 14 methods
// Required methods
fn check_error_details(&self) -> Result<ErrorDetails, DecodeError>;
fn get_error_details(&self) -> ErrorDetails;
fn check_error_details_vec(&self) -> Result<Vec<ErrorDetail>, DecodeError>;
fn get_error_details_vec(&self) -> Vec<ErrorDetail>;
fn get_details_retry_info(&self) -> Option<RetryInfo>;
fn get_details_debug_info(&self) -> Option<DebugInfo>;
fn get_details_quota_failure(&self) -> Option<QuotaFailure>;
fn get_details_error_info(&self) -> Option<ErrorInfo>;
fn get_details_precondition_failure(&self) -> Option<PreconditionFailure>;
fn get_details_bad_request(&self) -> Option<BadRequest>;
fn get_details_request_info(&self) -> Option<RequestInfo>;
fn get_details_resource_info(&self) -> Option<ResourceInfo>;
fn get_details_help(&self) -> Option<Help>;
fn get_details_localized_message(&self) -> Option<LocalizedMessage>;
}Expand description
Used to implement associated functions and methods on pb::Status, that
allow the extraction of standard error details. This trait is
sealed and not meant to be implemented outside of tonic-types.
Required Methods§
Sourcefn check_error_details(&self) -> Result<ErrorDetails, DecodeError>
fn check_error_details(&self) -> Result<ErrorDetails, DecodeError>
Can be used to check if the error details contained in 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.
Sourcefn get_error_details(&self) -> ErrorDetails
fn get_error_details(&self) -> ErrorDetails
Get an ErrorDetails struct from pb::Status. If some
prost::DecodeError occurs, an empty ErrorDetails struct will be
returned.
Sourcefn check_error_details_vec(&self) -> Result<Vec<ErrorDetail>, DecodeError>
fn check_error_details_vec(&self) -> Result<Vec<ErrorDetail>, DecodeError>
Can be used to check if the error details contained in 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.
Sourcefn get_error_details_vec(&self) -> Vec<ErrorDetail>
fn get_error_details_vec(&self) -> Vec<ErrorDetail>
Get a vector of ErrorDetail enums from pb::Status. If some
prost::DecodeError occurs, an empty vector will be returned.
Sourcefn get_details_retry_info(&self) -> Option<RetryInfo>
fn get_details_retry_info(&self) -> Option<RetryInfo>
Get first RetryInfo details found on pb::Status, if any. If
some prost::DecodeError occurs, returns None.
Sourcefn get_details_debug_info(&self) -> Option<DebugInfo>
fn get_details_debug_info(&self) -> Option<DebugInfo>
Get first DebugInfo details found on pb::Status, if any. If
some prost::DecodeError occurs, returns None.
Sourcefn get_details_quota_failure(&self) -> Option<QuotaFailure>
fn get_details_quota_failure(&self) -> Option<QuotaFailure>
Get first QuotaFailure details found on pb::Status, if any.
If some prost::DecodeError occurs, returns None.
Sourcefn get_details_error_info(&self) -> Option<ErrorInfo>
fn get_details_error_info(&self) -> Option<ErrorInfo>
Get first ErrorInfo details found on pb::Status, if any. If
some prost::DecodeError occurs, returns None.
Sourcefn get_details_precondition_failure(&self) -> Option<PreconditionFailure>
fn get_details_precondition_failure(&self) -> Option<PreconditionFailure>
Get first PreconditionFailure details found on pb::Status,
if any. If some prost::DecodeError occurs, returns None.
Sourcefn get_details_bad_request(&self) -> Option<BadRequest>
fn get_details_bad_request(&self) -> Option<BadRequest>
Get first BadRequest details found on pb::Status, if any. If
some prost::DecodeError occurs, returns None.
Sourcefn get_details_request_info(&self) -> Option<RequestInfo>
fn get_details_request_info(&self) -> Option<RequestInfo>
Get first RequestInfo details found on pb::Status, if any.
If some prost::DecodeError occurs, returns None.
Sourcefn get_details_resource_info(&self) -> Option<ResourceInfo>
fn get_details_resource_info(&self) -> Option<ResourceInfo>
Get first ResourceInfo details found on pb::Status, if any.
If some prost::DecodeError occurs, returns None.
Sourcefn get_details_help(&self) -> Option<Help>
fn get_details_help(&self) -> Option<Help>
Get first Help details found on pb::Status, if any. If some
prost::DecodeError occurs, returns None.
Sourcefn get_details_localized_message(&self) -> Option<LocalizedMessage>
fn get_details_localized_message(&self) -> Option<LocalizedMessage>
Get first LocalizedMessage details found on pb::Status, if
any. If some prost::DecodeError occurs, returns None.