#[non_exhaustive]pub struct LocalizedMessage {
pub locale: Option<String>,
pub message: Option<String>,
/* private fields */
}Available on crate features
images or instance-group-manager-resize-requests or instance-group-managers or instance-groups or instances or region-instance-group-managers or region-instance-groups or region-instance-templates or region-instances or region-operations or zone-operations only.Expand description
Provides a localized error message that is safe to return to the user which can be attached to an RPC error.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.locale: Option<String>The locale used following the specification defined at https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Examples are: “en-US”, “fr-CH”, “es-MX”
message: Option<String>The localized error message in the above locale.
Implementations§
Source§impl LocalizedMessage
impl LocalizedMessage
pub fn new() -> Self
Sourcepub fn set_locale<T>(self, v: T) -> Self
pub fn set_locale<T>(self, v: T) -> Self
Sets the value of locale.
Sourcepub fn set_or_clear_locale<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_locale<T>(self, v: Option<T>) -> Self
Sets or clears the value of locale.
Sourcepub fn set_message<T>(self, v: T) -> Self
pub fn set_message<T>(self, v: T) -> Self
Sets the value of message.
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 Message for LocalizedMessage
impl Message for LocalizedMessage
Source§impl PartialEq for LocalizedMessage
impl PartialEq for LocalizedMessage
impl StructuralPartialEq for LocalizedMessage
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