Enum zng::l10n::L10nArgument
source · pub enum L10nArgument {
Txt(Txt),
Number(FluentNumber),
}
Expand description
Represents an argument value for a localization message.
See L10nMessageBuilder::arg
for more details.
Variants§
Implementations§
source§impl L10nArgument
impl L10nArgument
sourcepub fn fluent_value(&self) -> FluentValue<'_>
pub fn fluent_value(&self) -> FluentValue<'_>
Borrow argument as a fluent value.
sourcepub fn to_fluent_value(&self) -> FluentValue<'static>
pub fn to_fluent_value(&self) -> FluentValue<'static>
Clone argument as a fluent value.
Trait Implementations§
source§impl Clone for L10nArgument
impl Clone for L10nArgument
source§fn clone(&self) -> L10nArgument
fn clone(&self) -> L10nArgument
Returns a copy 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 L10nArgument
impl Debug for L10nArgument
source§impl From<&'static str> for L10nArgument
impl From<&'static str> for L10nArgument
source§fn from(txt: &'static str) -> L10nArgument
fn from(txt: &'static str) -> L10nArgument
Converts to this type from the input type.
source§impl From<FluentNumber> for L10nArgument
impl From<FluentNumber> for L10nArgument
source§fn from(number: FluentNumber) -> L10nArgument
fn from(number: FluentNumber) -> L10nArgument
Converts to this type from the input type.
source§impl From<String> for L10nArgument
impl From<String> for L10nArgument
source§fn from(txt: String) -> L10nArgument
fn from(txt: String) -> L10nArgument
Converts to this type from the input type.
source§impl From<Txt> for L10nArgument
impl From<Txt> for L10nArgument
source§fn from(txt: Txt) -> L10nArgument
fn from(txt: Txt) -> L10nArgument
Converts to this type from the input type.
source§impl From<bool> for L10nArgument
impl From<bool> for L10nArgument
source§fn from(b: bool) -> L10nArgument
fn from(b: bool) -> L10nArgument
Converts to this type from the input type.
source§impl From<char> for L10nArgument
impl From<char> for L10nArgument
source§fn from(t: char) -> L10nArgument
fn from(t: char) -> L10nArgument
Converts to this type from the input type.
source§impl From<f32> for L10nArgument
impl From<f32> for L10nArgument
source§fn from(number: f32) -> L10nArgument
fn from(number: f32) -> L10nArgument
Converts to this type from the input type.
source§impl From<f64> for L10nArgument
impl From<f64> for L10nArgument
source§fn from(number: f64) -> L10nArgument
fn from(number: f64) -> L10nArgument
Converts to this type from the input type.
source§impl From<i128> for L10nArgument
impl From<i128> for L10nArgument
source§fn from(number: i128) -> L10nArgument
fn from(number: i128) -> L10nArgument
Converts to this type from the input type.
source§impl From<i16> for L10nArgument
impl From<i16> for L10nArgument
source§fn from(number: i16) -> L10nArgument
fn from(number: i16) -> L10nArgument
Converts to this type from the input type.
source§impl From<i32> for L10nArgument
impl From<i32> for L10nArgument
source§fn from(number: i32) -> L10nArgument
fn from(number: i32) -> L10nArgument
Converts to this type from the input type.
source§impl From<i64> for L10nArgument
impl From<i64> for L10nArgument
source§fn from(number: i64) -> L10nArgument
fn from(number: i64) -> L10nArgument
Converts to this type from the input type.
source§impl From<i8> for L10nArgument
impl From<i8> for L10nArgument
source§fn from(number: i8) -> L10nArgument
fn from(number: i8) -> L10nArgument
Converts to this type from the input type.
source§impl From<isize> for L10nArgument
impl From<isize> for L10nArgument
source§fn from(number: isize) -> L10nArgument
fn from(number: isize) -> L10nArgument
Converts to this type from the input type.
source§impl From<u128> for L10nArgument
impl From<u128> for L10nArgument
source§fn from(number: u128) -> L10nArgument
fn from(number: u128) -> L10nArgument
Converts to this type from the input type.
source§impl From<u16> for L10nArgument
impl From<u16> for L10nArgument
source§fn from(number: u16) -> L10nArgument
fn from(number: u16) -> L10nArgument
Converts to this type from the input type.
source§impl From<u32> for L10nArgument
impl From<u32> for L10nArgument
source§fn from(number: u32) -> L10nArgument
fn from(number: u32) -> L10nArgument
Converts to this type from the input type.
source§impl From<u64> for L10nArgument
impl From<u64> for L10nArgument
source§fn from(number: u64) -> L10nArgument
fn from(number: u64) -> L10nArgument
Converts to this type from the input type.
source§impl From<u8> for L10nArgument
impl From<u8> for L10nArgument
source§fn from(number: u8) -> L10nArgument
fn from(number: u8) -> L10nArgument
Converts to this type from the input type.
source§impl From<usize> for L10nArgument
impl From<usize> for L10nArgument
source§fn from(number: usize) -> L10nArgument
fn from(number: usize) -> L10nArgument
Converts to this type from the input type.
source§impl IntoVar<L10nArgument> for &'static str
impl IntoVar<L10nArgument> for &'static str
source§fn into_var(self) -> <&'static str as IntoVar<L10nArgument>>::Var
fn into_var(self) -> <&'static str as IntoVar<L10nArgument>>::Var
Converts the source value into a var.
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
Converts into
BoxedVar<T>
. Read moresource§impl IntoVar<L10nArgument> for FluentNumber
impl IntoVar<L10nArgument> for FluentNumber
source§fn into_var(self) -> <FluentNumber as IntoVar<L10nArgument>>::Var
fn into_var(self) -> <FluentNumber as IntoVar<L10nArgument>>::Var
Converts the source value into a var.
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
Converts into
BoxedVar<T>
. Read moresource§impl IntoVar<L10nArgument> for String
impl IntoVar<L10nArgument> for String
source§fn into_var(self) -> <String as IntoVar<L10nArgument>>::Var
fn into_var(self) -> <String as IntoVar<L10nArgument>>::Var
Converts the source value into a var.
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
Converts into
BoxedVar<T>
. Read moresource§impl IntoVar<L10nArgument> for Txt
impl IntoVar<L10nArgument> for Txt
source§fn into_var(self) -> <Txt as IntoVar<L10nArgument>>::Var
fn into_var(self) -> <Txt as IntoVar<L10nArgument>>::Var
Converts the source value into a var.
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
Converts into
BoxedVar<T>
. Read moresource§impl IntoVar<L10nArgument> for bool
impl IntoVar<L10nArgument> for bool
source§fn into_var(self) -> <bool as IntoVar<L10nArgument>>::Var
fn into_var(self) -> <bool as IntoVar<L10nArgument>>::Var
Converts the source value into a var.
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
Converts into
BoxedVar<T>
. Read moresource§impl IntoVar<L10nArgument> for char
impl IntoVar<L10nArgument> for char
source§fn into_var(self) -> <char as IntoVar<L10nArgument>>::Var
fn into_var(self) -> <char as IntoVar<L10nArgument>>::Var
Converts the source value into a var.
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
Converts into
BoxedVar<T>
. Read moresource§impl IntoVar<L10nArgument> for f32
impl IntoVar<L10nArgument> for f32
source§fn into_var(self) -> <f32 as IntoVar<L10nArgument>>::Var
fn into_var(self) -> <f32 as IntoVar<L10nArgument>>::Var
Converts the source value into a var.
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
Converts into
BoxedVar<T>
. Read moresource§impl IntoVar<L10nArgument> for f64
impl IntoVar<L10nArgument> for f64
source§fn into_var(self) -> <f64 as IntoVar<L10nArgument>>::Var
fn into_var(self) -> <f64 as IntoVar<L10nArgument>>::Var
Converts the source value into a var.
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
Converts into
BoxedVar<T>
. Read moresource§impl IntoVar<L10nArgument> for i128
impl IntoVar<L10nArgument> for i128
source§fn into_var(self) -> <i128 as IntoVar<L10nArgument>>::Var
fn into_var(self) -> <i128 as IntoVar<L10nArgument>>::Var
Converts the source value into a var.
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
Converts into
BoxedVar<T>
. Read moresource§impl IntoVar<L10nArgument> for i16
impl IntoVar<L10nArgument> for i16
source§fn into_var(self) -> <i16 as IntoVar<L10nArgument>>::Var
fn into_var(self) -> <i16 as IntoVar<L10nArgument>>::Var
Converts the source value into a var.
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
Converts into
BoxedVar<T>
. Read moresource§impl IntoVar<L10nArgument> for i32
impl IntoVar<L10nArgument> for i32
source§fn into_var(self) -> <i32 as IntoVar<L10nArgument>>::Var
fn into_var(self) -> <i32 as IntoVar<L10nArgument>>::Var
Converts the source value into a var.
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
Converts into
BoxedVar<T>
. Read moresource§impl IntoVar<L10nArgument> for i64
impl IntoVar<L10nArgument> for i64
source§fn into_var(self) -> <i64 as IntoVar<L10nArgument>>::Var
fn into_var(self) -> <i64 as IntoVar<L10nArgument>>::Var
Converts the source value into a var.
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
Converts into
BoxedVar<T>
. Read moresource§impl IntoVar<L10nArgument> for i8
impl IntoVar<L10nArgument> for i8
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
Converts into
BoxedVar<T>
. Read moresource§impl IntoVar<L10nArgument> for isize
impl IntoVar<L10nArgument> for isize
source§fn into_var(self) -> <isize as IntoVar<L10nArgument>>::Var
fn into_var(self) -> <isize as IntoVar<L10nArgument>>::Var
Converts the source value into a var.
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
Converts into
BoxedVar<T>
. Read moresource§impl IntoVar<L10nArgument> for u128
impl IntoVar<L10nArgument> for u128
source§fn into_var(self) -> <u128 as IntoVar<L10nArgument>>::Var
fn into_var(self) -> <u128 as IntoVar<L10nArgument>>::Var
Converts the source value into a var.
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
Converts into
BoxedVar<T>
. Read moresource§impl IntoVar<L10nArgument> for u16
impl IntoVar<L10nArgument> for u16
source§fn into_var(self) -> <u16 as IntoVar<L10nArgument>>::Var
fn into_var(self) -> <u16 as IntoVar<L10nArgument>>::Var
Converts the source value into a var.
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
Converts into
BoxedVar<T>
. Read moresource§impl IntoVar<L10nArgument> for u32
impl IntoVar<L10nArgument> for u32
source§fn into_var(self) -> <u32 as IntoVar<L10nArgument>>::Var
fn into_var(self) -> <u32 as IntoVar<L10nArgument>>::Var
Converts the source value into a var.
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
Converts into
BoxedVar<T>
. Read moresource§impl IntoVar<L10nArgument> for u64
impl IntoVar<L10nArgument> for u64
source§fn into_var(self) -> <u64 as IntoVar<L10nArgument>>::Var
fn into_var(self) -> <u64 as IntoVar<L10nArgument>>::Var
Converts the source value into a var.
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
Converts into
BoxedVar<T>
. Read moresource§impl IntoVar<L10nArgument> for u8
impl IntoVar<L10nArgument> for u8
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
Converts into
BoxedVar<T>
. Read moresource§impl IntoVar<L10nArgument> for usize
impl IntoVar<L10nArgument> for usize
source§fn into_var(self) -> <usize as IntoVar<L10nArgument>>::Var
fn into_var(self) -> <usize as IntoVar<L10nArgument>>::Var
Converts the source value into a var.
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
Converts into
BoxedVar<T>
. Read moresource§impl PartialEq for L10nArgument
impl PartialEq for L10nArgument
impl IntoValue<L10nArgument> for &'static str
impl IntoValue<L10nArgument> for FluentNumber
impl IntoValue<L10nArgument> for String
impl IntoValue<L10nArgument> for Txt
impl IntoValue<L10nArgument> for bool
impl IntoValue<L10nArgument> for char
impl IntoValue<L10nArgument> for f32
impl IntoValue<L10nArgument> for f64
impl IntoValue<L10nArgument> for i128
impl IntoValue<L10nArgument> for i16
impl IntoValue<L10nArgument> for i32
impl IntoValue<L10nArgument> for i64
impl IntoValue<L10nArgument> for i8
impl IntoValue<L10nArgument> for isize
impl IntoValue<L10nArgument> for u128
impl IntoValue<L10nArgument> for u16
impl IntoValue<L10nArgument> for u32
impl IntoValue<L10nArgument> for u64
impl IntoValue<L10nArgument> for u8
impl IntoValue<L10nArgument> for usize
impl StructuralPartialEq for L10nArgument
Auto Trait Implementations§
impl Freeze for L10nArgument
impl RefUnwindSafe for L10nArgument
impl Send for L10nArgument
impl Sync for L10nArgument
impl Unpin for L10nArgument
impl UnwindSafe for L10nArgument
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
source§impl<T> AnyVarValue for Twhere
T: VarValue,
impl<T> AnyVarValue for Twhere
T: VarValue,
source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Access to mut
dyn Any
methods.source§fn clone_boxed(&self) -> Box<dyn AnyVarValue>
fn clone_boxed(&self) -> Box<dyn AnyVarValue>
Clone the value.
source§fn clone_boxed_var(&self) -> Box<dyn AnyVar>
fn clone_boxed_var(&self) -> Box<dyn AnyVar>
Clone the value into a new boxed
LocalVar<Self>
.source§fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
Gets if
self
equals other
.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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
source§impl<T> FsChangeNote for T
impl<T> FsChangeNote for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more