Struct tonic_richer_error::LocalizedMessage
source · pub struct LocalizedMessage {
pub locale: String,
pub message: String,
}
Expand description
Used to encode/decode the LocalizedMessage
standard error message
described in error_details.proto. Provides a localized error message
that is safe to return to the user.
Fields§
§locale: String
Locale used, following the specification defined in BCP 47. For example: “en-US”, “fr-CH” or “es-MX”.
message: String
Message corresponding to the locale.
Implementations§
source§impl LocalizedMessage
impl LocalizedMessage
sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true
if LocalizedMessage
fields are empty, and false
if
they are not.
Trait Implementations§
source§impl Clone for LocalizedMessage
impl Clone for LocalizedMessage
source§fn clone(&self) -> LocalizedMessage
fn clone(&self) -> LocalizedMessage
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for LocalizedMessage
impl Debug for LocalizedMessage
source§impl From<LocalizedMessage> for ErrorDetail
impl From<LocalizedMessage> for ErrorDetail
source§fn from(err_detail: LocalizedMessage) -> Self
fn from(err_detail: LocalizedMessage) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl RefUnwindSafe for LocalizedMessage
impl Send for LocalizedMessage
impl Sync for LocalizedMessage
impl Unpin for LocalizedMessage
impl UnwindSafe for LocalizedMessage
Blanket Implementations§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request