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 const TYPE_URL: &'static str = "type.googleapis.com/google.rpc.LocalizedMessage"
pub const TYPE_URL: &'static str = "type.googleapis.com/google.rpc.LocalizedMessage"
Type URL of the LocalizedMessage
standard error message type.
Sourcepub fn new(locale: impl Into<String>, message: impl Into<String>) -> Self
pub fn new(locale: impl Into<String>, message: impl Into<String>) -> Self
Creates a new LocalizedMessage
struct.
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 duplicate 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 Default for LocalizedMessage
impl Default for LocalizedMessage
Source§fn default() -> LocalizedMessage
fn default() -> LocalizedMessage
Returns the “default value” for a type. Read more
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.
Source§impl From<LocalizedMessage> for LocalizedMessage
impl From<LocalizedMessage> for LocalizedMessage
Source§fn from(loc_message: LocalizedMessage) -> Self
fn from(loc_message: LocalizedMessage) -> Self
Converts to this type from the input type.
Source§impl From<LocalizedMessage> for LocalizedMessage
impl From<LocalizedMessage> for LocalizedMessage
Source§fn from(loc_message: LocalizedMessage) -> Self
fn from(loc_message: LocalizedMessage) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for LocalizedMessage
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> 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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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