Enum gooey::fluent::fluent::FluentValue
[−]pub enum FluentValue<'source> {
String(Cow<'source, str>),
Number(FluentNumber),
Custom(Box<dyn FluentType + Send + 'static, Global>),
None,
Error,
}
Expand description
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 + Send + 'static, Global>)
None
Error
Implementations
impl<'source> FluentValue<'source>
impl<'source> FluentValue<'source>
pub fn try_number<S>(v: S) -> FluentValue<'source> where
S: ToString,
pub fn matches<R, M>(
&self,
other: &FluentValue<'_>,
scope: &Scope<'_, '_, R, M>
) -> bool where
R: Borrow<FluentResource>,
M: MemoizerKind,
pub fn write<W, R, M>(
&self,
w: &mut W,
scope: &Scope<'_, '_, R, M>
) -> Result<(), Error> where
W: Write,
R: Borrow<FluentResource>,
M: MemoizerKind,
pub fn as_string<R, M>(&self, scope: &Scope<'_, '_, R, M>) -> Cow<'source, str> where
R: Borrow<FluentResource>,
M: MemoizerKind,
Trait Implementations
impl<'s> Clone for FluentValue<'s>
impl<'s> Clone for FluentValue<'s>
fn clone(&self) -> FluentValue<'s>
fn clone(&self) -> FluentValue<'s>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<'source> Debug for FluentValue<'source>
impl<'source> Debug for FluentValue<'source>
impl<'_, '_> From<&'_ f32> for FluentValue<'_>
impl<'_, '_> From<&'_ f32> for FluentValue<'_>
fn from(n: &f32) -> FluentValue<'_>
fn from(n: &f32) -> FluentValue<'_>
Converts to this type from the input type.
impl<'_, '_> From<&'_ f64> for FluentValue<'_>
impl<'_, '_> From<&'_ f64> for FluentValue<'_>
fn from(n: &f64) -> FluentValue<'_>
fn from(n: &f64) -> FluentValue<'_>
Converts to this type from the input type.
impl<'_, '_> From<&'_ i128> for FluentValue<'_>
impl<'_, '_> From<&'_ i128> for FluentValue<'_>
fn from(n: &i128) -> FluentValue<'_>
fn from(n: &i128) -> FluentValue<'_>
Converts to this type from the input type.
impl<'_, '_> From<&'_ i16> for FluentValue<'_>
impl<'_, '_> From<&'_ i16> for FluentValue<'_>
fn from(n: &i16) -> FluentValue<'_>
fn from(n: &i16) -> FluentValue<'_>
Converts to this type from the input type.
impl<'_, '_> From<&'_ i32> for FluentValue<'_>
impl<'_, '_> From<&'_ i32> for FluentValue<'_>
fn from(n: &i32) -> FluentValue<'_>
fn from(n: &i32) -> FluentValue<'_>
Converts to this type from the input type.
impl<'_, '_> From<&'_ i64> for FluentValue<'_>
impl<'_, '_> From<&'_ i64> for FluentValue<'_>
fn from(n: &i64) -> FluentValue<'_>
fn from(n: &i64) -> FluentValue<'_>
Converts to this type from the input type.
impl<'_, '_> From<&'_ i8> for FluentValue<'_>
impl<'_, '_> From<&'_ i8> for FluentValue<'_>
fn from(n: &i8) -> FluentValue<'_>
fn from(n: &i8) -> FluentValue<'_>
Converts to this type from the input type.
impl<'_, '_> From<&'_ isize> for FluentValue<'_>
impl<'_, '_> From<&'_ isize> for FluentValue<'_>
fn from(n: &isize) -> FluentValue<'_>
fn from(n: &isize) -> FluentValue<'_>
Converts to this type from the input type.
impl<'_, '_> From<&'_ u128> for FluentValue<'_>
impl<'_, '_> From<&'_ u128> for FluentValue<'_>
fn from(n: &u128) -> FluentValue<'_>
fn from(n: &u128) -> FluentValue<'_>
Converts to this type from the input type.
impl<'_, '_> From<&'_ u16> for FluentValue<'_>
impl<'_, '_> From<&'_ u16> for FluentValue<'_>
fn from(n: &u16) -> FluentValue<'_>
fn from(n: &u16) -> FluentValue<'_>
Converts to this type from the input type.
impl<'_, '_> From<&'_ u32> for FluentValue<'_>
impl<'_, '_> From<&'_ u32> for FluentValue<'_>
fn from(n: &u32) -> FluentValue<'_>
fn from(n: &u32) -> FluentValue<'_>
Converts to this type from the input type.
impl<'_, '_> From<&'_ u64> for FluentValue<'_>
impl<'_, '_> From<&'_ u64> for FluentValue<'_>
fn from(n: &u64) -> FluentValue<'_>
fn from(n: &u64) -> FluentValue<'_>
Converts to this type from the input type.
impl<'_, '_> From<&'_ u8> for FluentValue<'_>
impl<'_, '_> From<&'_ u8> for FluentValue<'_>
fn from(n: &u8) -> FluentValue<'_>
fn from(n: &u8) -> FluentValue<'_>
Converts to this type from the input type.
impl<'_, '_> From<&'_ usize> for FluentValue<'_>
impl<'_, '_> From<&'_ usize> for FluentValue<'_>
fn from(n: &usize) -> FluentValue<'_>
fn from(n: &usize) -> FluentValue<'_>
Converts to this type from the input type.
impl<'source> From<&'source str> for FluentValue<'source>
impl<'source> From<&'source str> for FluentValue<'source>
fn from(s: &'source str) -> FluentValue<'source>
fn from(s: &'source str) -> FluentValue<'source>
Converts to this type from the input type.
impl<'source> From<Cow<'source, str>> for FluentValue<'source>
impl<'source> From<Cow<'source, str>> for FluentValue<'source>
fn from(s: Cow<'source, str>) -> FluentValue<'source>
fn from(s: Cow<'source, str>) -> FluentValue<'source>
Converts to this type from the input type.
impl<'l> From<FluentNumber> for FluentValue<'l>
impl<'l> From<FluentNumber> for FluentValue<'l>
fn from(input: FluentNumber) -> FluentValue<'l>
fn from(input: FluentNumber) -> FluentValue<'l>
Converts to this type from the input type.
impl<'source> From<String> for FluentValue<'source>
impl<'source> From<String> for FluentValue<'source>
fn from(s: String) -> FluentValue<'source>
fn from(s: String) -> FluentValue<'source>
Converts to this type from the input type.
impl<'_> From<f32> for FluentValue<'_>
impl<'_> From<f32> for FluentValue<'_>
fn from(n: f32) -> FluentValue<'_>
fn from(n: f32) -> FluentValue<'_>
Converts to this type from the input type.
impl<'_> From<f64> for FluentValue<'_>
impl<'_> From<f64> for FluentValue<'_>
fn from(n: f64) -> FluentValue<'_>
fn from(n: f64) -> FluentValue<'_>
Converts to this type from the input type.
impl<'_> From<i128> for FluentValue<'_>
impl<'_> From<i128> for FluentValue<'_>
fn from(n: i128) -> FluentValue<'_>
fn from(n: i128) -> FluentValue<'_>
Converts to this type from the input type.
impl<'_> From<i16> for FluentValue<'_>
impl<'_> From<i16> for FluentValue<'_>
fn from(n: i16) -> FluentValue<'_>
fn from(n: i16) -> FluentValue<'_>
Converts to this type from the input type.
impl<'_> From<i32> for FluentValue<'_>
impl<'_> From<i32> for FluentValue<'_>
fn from(n: i32) -> FluentValue<'_>
fn from(n: i32) -> FluentValue<'_>
Converts to this type from the input type.
impl<'_> From<i64> for FluentValue<'_>
impl<'_> From<i64> for FluentValue<'_>
fn from(n: i64) -> FluentValue<'_>
fn from(n: i64) -> FluentValue<'_>
Converts to this type from the input type.
impl<'_> From<i8> for FluentValue<'_>
impl<'_> From<i8> for FluentValue<'_>
fn from(n: i8) -> FluentValue<'_>
fn from(n: i8) -> FluentValue<'_>
Converts to this type from the input type.
impl<'_> From<isize> for FluentValue<'_>
impl<'_> From<isize> for FluentValue<'_>
fn from(n: isize) -> FluentValue<'_>
fn from(n: isize) -> FluentValue<'_>
Converts to this type from the input type.
impl<'_> From<u128> for FluentValue<'_>
impl<'_> From<u128> for FluentValue<'_>
fn from(n: u128) -> FluentValue<'_>
fn from(n: u128) -> FluentValue<'_>
Converts to this type from the input type.
impl<'_> From<u16> for FluentValue<'_>
impl<'_> From<u16> for FluentValue<'_>
fn from(n: u16) -> FluentValue<'_>
fn from(n: u16) -> FluentValue<'_>
Converts to this type from the input type.
impl<'_> From<u32> for FluentValue<'_>
impl<'_> From<u32> for FluentValue<'_>
fn from(n: u32) -> FluentValue<'_>
fn from(n: u32) -> FluentValue<'_>
Converts to this type from the input type.
impl<'_> From<u64> for FluentValue<'_>
impl<'_> From<u64> for FluentValue<'_>
fn from(n: u64) -> FluentValue<'_>
fn from(n: u64) -> FluentValue<'_>
Converts to this type from the input type.
impl<'_> From<u8> for FluentValue<'_>
impl<'_> From<u8> for FluentValue<'_>
fn from(n: u8) -> FluentValue<'_>
fn from(n: u8) -> FluentValue<'_>
Converts to this type from the input type.
impl<'_> From<usize> for FluentValue<'_>
impl<'_> From<usize> for FluentValue<'_>
fn from(n: usize) -> FluentValue<'_>
fn from(n: usize) -> FluentValue<'_>
Converts to this type from the input type.
impl<'s> PartialEq<FluentValue<'s>> for FluentValue<'s>
impl<'s> PartialEq<FluentValue<'s>> for FluentValue<'s>
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
sourceimpl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
T: FloatComponent,
Swp: WhitePoint,
Dwp: WhitePoint,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
T: FloatComponent,
Swp: WhitePoint,
Dwp: WhitePoint,
D: AdaptFrom<S, Swp, Dwp, T>,
sourcefn adapt_into_using<M>(self, method: M) -> D where
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into_using<M>(self, method: M) -> D where
M: TransformMatrix<Swp, Dwp, T>,
Convert the source color to the destination color using the specified method Read more
sourcefn adapt_into(self) -> D
fn adapt_into(self) -> D
Convert the source color to the destination color using the bradford method by default Read more
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
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T, U> IntoColor<U> for T where
U: FromColor<T>,
impl<T, U> IntoColor<U> for T where
U: FromColor<T>,
sourcefn into_color(self) -> U
fn into_color(self) -> U
Convert into T with values clamped to the color defined bounds Read more
sourceimpl<T, U> IntoColorUnclamped<U> for T where
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for T where
U: FromColorUnclamped<T>,
sourcefn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
Convert into T. The resulting color might be invalid in its color space Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T, U> TryIntoColor<U> for T where
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for T where
U: TryFromColor<T>,
sourcefn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
Convert into T, returning ok if the color is inside of its defined
range, otherwise an OutOfBounds
error is returned which contains
the unclamped color. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more