Skip to main content

Languages

Trait Languages 

Source
pub trait Languages {
    type Language: Language + ?Sized;

    // Required methods
    fn get(&self, lang: &str) -> Result<&Self::Language>;
    fn get_mut(&mut self, lang: &str) -> Result<&mut Self::Language>;

    // Provided method
    fn canonical<'a>(&'a self, lang: &'a str) -> &'a str { ... }
}

Required Associated Types§

Required Methods§

Source

fn get(&self, lang: &str) -> Result<&Self::Language>

Source

fn get_mut(&mut self, lang: &str) -> Result<&mut Self::Language>

Provided Methods§

Source

fn canonical<'a>(&'a self, lang: &'a str) -> &'a str

The canonical registry key for lang, resolving aliases (python → py); identity for unknown names. The machine park keys by this, so Multi::machine hands the same machine to every alias.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§