[−][src]Enum fluent_bundle::types::FluentValue
The FluentValue
enum represents values which can be formatted to a String.
The ResolveValue
trait from the resolve
module evaluates AST nodes into
FluentValues
which can then be formatted to Strings using the i18n formatters stored by the
FluentBundle
instance if required.
The arguments HashMap
passed to FluentBundle::format
should also use FluentValues
as values of arguments.
Variants
Number(FluentNumber)
Custom(Box<dyn FluentType + Send>)
Error(DisplayableNode<'source>)
Methods
impl<'source> FluentValue<'source>
[src]
pub fn try_number<S: ToString>(v: S) -> Self
[src]
pub fn matches<R: Borrow<FluentResource>, M: MemoizerKind>(
&self,
other: &FluentValue,
scope: &Scope<R, M>
) -> bool
[src]
&self,
other: &FluentValue,
scope: &Scope<R, M>
) -> bool
pub fn as_string<R: Borrow<FluentResource>, M: MemoizerKind>(
&self,
scope: &Scope<R, M>
) -> Cow<'source, str>
[src]
&self,
scope: &Scope<R, M>
) -> Cow<'source, str>
Trait Implementations
impl<'s> Clone for FluentValue<'s>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'source> Debug for FluentValue<'source>
[src]
impl<'_, '_> From<&'_ f32> for FluentValue<'_>
[src]
impl<'_, '_> From<&'_ f64> for FluentValue<'_>
[src]
impl<'_, '_> From<&'_ i128> for FluentValue<'_>
[src]
impl<'_, '_> From<&'_ i16> for FluentValue<'_>
[src]
impl<'_, '_> From<&'_ i32> for FluentValue<'_>
[src]
impl<'_, '_> From<&'_ i64> for FluentValue<'_>
[src]
impl<'_, '_> From<&'_ i8> for FluentValue<'_>
[src]
impl<'_, '_> From<&'_ isize> for FluentValue<'_>
[src]
impl<'_, '_> From<&'_ u128> for FluentValue<'_>
[src]
impl<'_, '_> From<&'_ u16> for FluentValue<'_>
[src]
impl<'_, '_> From<&'_ u32> for FluentValue<'_>
[src]
impl<'_, '_> From<&'_ u64> for FluentValue<'_>
[src]
impl<'_, '_> From<&'_ u8> for FluentValue<'_>
[src]
impl<'_, '_> From<&'_ usize> for FluentValue<'_>
[src]
impl<'source> From<&'source str> for FluentValue<'source>
[src]
impl<'source> From<Cow<'source, str>> for FluentValue<'source>
[src]
impl<'l> From<FluentNumber> for FluentValue<'l>
[src]
fn from(input: FluentNumber) -> Self
[src]
impl<'source> From<String> for FluentValue<'source>
[src]
impl<'_> From<f32> for FluentValue<'_>
[src]
impl<'_> From<f64> for FluentValue<'_>
[src]
impl<'_> From<i128> for FluentValue<'_>
[src]
impl<'_> From<i16> for FluentValue<'_>
[src]
impl<'_> From<i32> for FluentValue<'_>
[src]
impl<'_> From<i64> for FluentValue<'_>
[src]
impl<'_> From<i8> for FluentValue<'_>
[src]
impl<'_> From<isize> for FluentValue<'_>
[src]
impl<'_> From<u128> for FluentValue<'_>
[src]
impl<'_> From<u16> for FluentValue<'_>
[src]
impl<'_> From<u32> for FluentValue<'_>
[src]
impl<'_> From<u64> for FluentValue<'_>
[src]
impl<'_> From<u8> for FluentValue<'_>
[src]
impl<'_> From<usize> for FluentValue<'_>
[src]
impl<'s> PartialEq<FluentValue<'s>> for FluentValue<'s>
[src]
Auto Trait Implementations
impl<'source> !RefUnwindSafe for FluentValue<'source>
impl<'source> Send for FluentValue<'source>
impl<'source> !Sync for FluentValue<'source>
impl<'source> Unpin for FluentValue<'source>
impl<'source> !UnwindSafe for FluentValue<'source>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> AnyEq for T where
T: PartialEq<T> + Any,
[src]
T: PartialEq<T> + Any,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,