LocalFmt

Struct LocalFmt 

Source
pub struct LocalFmt<L: Enumable + Copy, M, const N: usize> { /* private fields */ }
Expand description

A struct that holds a message and the language it is in.

Implementations§

Source§

impl<L: Enumable + Copy, M, const N: usize> LocalFmt<L, M, N>

Source

pub const fn new(messages: EnumTable<L, M, N>, lang: fn() -> L) -> Self

Source

pub fn get_message(&self) -> &M

Returns the message in the current language.

Source

pub fn lang(&self) -> L

Returns the language.

Trait Implementations§

Source§

impl<L: Enumable + Copy, M, const N: usize> Deref for LocalFmt<L, M, N>

Source§

fn deref(&self) -> &Self::Target

Returns the message in the current language.

Source§

type Target = M

The resulting type after dereferencing.

Auto Trait Implementations§

§

impl<L, M, const N: usize> Freeze for LocalFmt<L, M, N>
where M: Freeze,

§

impl<L, M, const N: usize> RefUnwindSafe for LocalFmt<L, M, N>

§

impl<L, M, const N: usize> Send for LocalFmt<L, M, N>
where L: Send, M: Send,

§

impl<L, M, const N: usize> Sync for LocalFmt<L, M, N>
where L: Sync, M: Sync,

§

impl<L, M, const N: usize> Unpin for LocalFmt<L, M, N>
where L: Unpin, M: Unpin,

§

impl<L, M, const N: usize> UnwindSafe for LocalFmt<L, M, N>
where L: UnwindSafe, M: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.