[][src]Struct druid::text::format::ParseFormatter

#[non_exhaustive]pub struct ParseFormatter<T> { /* fields omitted */ }

A naive Formatter for types that implement FromStr.

For types that implement std::fmt::Display, the ParseFormatter::new constructor creates a formatter that format's it's value using that trait. If you would like to customize the formatting, you can use the ParseFormatter::with_format_fn constructor, and pass your own formatting function.

Implementations

impl<T: Display> ParseFormatter<T>[src]

pub fn new() -> Self[src]

Create a new ParseFormatter.

impl<T> ParseFormatter<T>[src]

pub fn with_format_fn(f: impl Fn(&T) -> String + 'static) -> Self[src]

Create a new ParseFormatter using the provided formatting function. provided function.

Trait Implementations

impl<T: Display> Default for ParseFormatter<T>[src]

impl<T> Formatter<T> for ParseFormatter<T> where
    T: FromStr,
    <T as FromStr>::Err: Error + 'static, 
[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[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> RoundFrom<T> for T

impl<T, U> RoundInto<U> for T where
    U: RoundFrom<T>, 

impl<T> Same<T> for T

type Output = T

Should always be Self

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.