Struct embedded_lang::Language
source · [−]pub struct Language { /* private fields */ }
Expand description
Represents a single language lookup instance
Implementations
sourceimpl Language
impl Language
sourcepub fn new(
name: String,
short_name: String,
strings: HashMap<String, String>
) -> Self
pub fn new(
name: String,
short_name: String,
strings: HashMap<String, String>
) -> Self
Create a new language instance
Arguments
name
- Full language nameshort_name
- Language codestrings
- Language lookup table
sourcepub fn new_from_string(json: &str) -> Result<Self, String>
pub fn new_from_string(json: &str) -> Result<Self, String>
sourcepub fn new_from_file(path: &str) -> Result<Self, String>
pub fn new_from_file(path: &str) -> Result<Self, String>
sourcepub fn short_name(&self) -> &str
pub fn short_name(&self) -> &str
Get language code
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Language
impl<'de> Deserialize<'de> for Language
sourcefn 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 RefUnwindSafe for Language
impl Send for Language
impl Sync for Language
impl Unpin for Language
impl UnwindSafe for Language
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more