pub struct TranslationLanguage {
pub language: String,
pub language_code: String,
}
Expand description
§TranslationLanguage
Represents a language option available for YouTube transcript translation.
This struct contains both the human-readable language name and the ISO language code that YouTube uses to identify the language.
§Fields
language
- The full, human-readable name of the language (e.g., “English”)language_code
- The ISO language code used by YouTube (e.g., “en”)
§Example Usage
let english = TranslationLanguage {
language: "English".to_string(),
language_code: "en".to_string(),
};
println!("Language: {} ({})", english.language, english.language_code);
Fields§
§language: String
The human-readable language name (e.g., “English”, “Español”, “Français”)
language_code: String
The ISO language code used by YouTube’s API (e.g., “en”, “es”, “fr”)
Trait Implementations§
Source§impl Clone for TranslationLanguage
impl Clone for TranslationLanguage
Source§fn clone(&self) -> TranslationLanguage
fn clone(&self) -> TranslationLanguage
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TranslationLanguage
impl Debug for TranslationLanguage
Source§impl<'de> Deserialize<'de> for TranslationLanguage
impl<'de> Deserialize<'de> for TranslationLanguage
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TranslationLanguage
impl RefUnwindSafe for TranslationLanguage
impl Send for TranslationLanguage
impl Sync for TranslationLanguage
impl Unpin for TranslationLanguage
impl UnwindSafe for TranslationLanguage
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