#[non_exhaustive]pub struct SupportedLanguage {
pub language_code: String,
pub display_name: String,
pub support_source: bool,
pub support_target: bool,
/* private fields */
}Expand description
A single supported language response corresponds to information related to one supported language.
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.language_code: StringSupported language code, generally consisting of its ISO 639-1 identifier, for example, ‘en’, ‘ja’. In certain cases, ISO-639 codes including language and region identifiers are returned (for example, ‘zh-TW’ and ‘zh-CN’).
display_name: StringHuman-readable name of the language localized in the display language specified in the request.
support_source: boolCan be used as a source language.
support_target: boolCan be used as a target language.
Implementations§
Source§impl SupportedLanguage
impl SupportedLanguage
pub fn new() -> Self
Sourcepub fn set_language_code<T: Into<String>>(self, v: T) -> Self
pub fn set_language_code<T: Into<String>>(self, v: T) -> Self
Sets the value of language_code.
§Example
ⓘ
let x = SupportedLanguage::new().set_language_code("example");Sourcepub fn set_display_name<T: Into<String>>(self, v: T) -> Self
pub fn set_display_name<T: Into<String>>(self, v: T) -> Self
Sets the value of display_name.
§Example
ⓘ
let x = SupportedLanguage::new().set_display_name("example");Sourcepub fn set_support_source<T: Into<bool>>(self, v: T) -> Self
pub fn set_support_source<T: Into<bool>>(self, v: T) -> Self
Sets the value of support_source.
§Example
ⓘ
let x = SupportedLanguage::new().set_support_source(true);Sourcepub fn set_support_target<T: Into<bool>>(self, v: T) -> Self
pub fn set_support_target<T: Into<bool>>(self, v: T) -> Self
Sets the value of support_target.
§Example
ⓘ
let x = SupportedLanguage::new().set_support_target(true);Trait Implementations§
Source§impl Clone for SupportedLanguage
impl Clone for SupportedLanguage
Source§fn clone(&self) -> SupportedLanguage
fn clone(&self) -> SupportedLanguage
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 SupportedLanguage
impl Debug for SupportedLanguage
Source§impl Default for SupportedLanguage
impl Default for SupportedLanguage
Source§fn default() -> SupportedLanguage
fn default() -> SupportedLanguage
Returns the “default value” for a type. Read more
Source§impl Message for SupportedLanguage
impl Message for SupportedLanguage
Source§impl PartialEq for SupportedLanguage
impl PartialEq for SupportedLanguage
impl StructuralPartialEq for SupportedLanguage
Auto Trait Implementations§
impl Freeze for SupportedLanguage
impl RefUnwindSafe for SupportedLanguage
impl Send for SupportedLanguage
impl Sync for SupportedLanguage
impl Unpin for SupportedLanguage
impl UnsafeUnpin for SupportedLanguage
impl UnwindSafe for SupportedLanguage
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