[][src]Enum fluent::FluentValue

pub enum FluentValue<'source> {
    String(Cow<'source, str>),
    Number(FluentNumber),
    Custom(Box<dyn FluentType + 'static + Send, Global>),
    None,
    Error,
}

The FluentValue enum represents values which can be formatted to a String.

Those values are either passed as arguments to FluentBundle::format_pattern or produced by functions, or generated in the process of pattern resolution.

Variants

String(Cow<'source, str>)
Number(FluentNumber)
Custom(Box<dyn FluentType + 'static + Send, Global>)
None
Error

Implementations

impl<'source> FluentValue<'source>[src]

pub fn try_number<S>(v: S) -> FluentValue<'source> where
    S: ToString
[src]

pub fn matches<R, M>(
    &self,
    other: &FluentValue<'_>,
    scope: &Scope<'_, '_, R, M>
) -> bool where
    R: Borrow<FluentResource>,
    M: MemoizerKind
[src]

pub fn write<W, R, M>(
    &self,
    w: &mut W,
    scope: &Scope<'_, '_, R, M>
) -> Result<(), Error> where
    R: Borrow<FluentResource>,
    M: MemoizerKind,
    W: Write
[src]

pub fn as_string<R, M>(&self, scope: &Scope<'_, '_, R, M>) -> Cow<'source, str> where
    R: Borrow<FluentResource>,
    M: MemoizerKind
[src]

Trait Implementations

impl<'s> Clone for FluentValue<'s>[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]

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>[src]

impl<'source> Send for FluentValue<'source>[src]

impl<'source> !Sync for FluentValue<'source>[src]

impl<'source> Unpin for FluentValue<'source>[src]

impl<'source> !UnwindSafe for FluentValue<'source>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> AnyEq for T where
    T: PartialEq<T> + Any
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.