[−][src]Struct druid::text::format::ParseFormatter
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]
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]
T: FromStr,
<T as FromStr>::Err: Error + 'static,
pub fn format(&self, value: &T) -> String
[src]
pub fn validate_partial_input(
&self,
input: &str,
_sel: &Selection
) -> Validation
[src]
&self,
input: &str,
_sel: &Selection
) -> Validation
pub fn value(&self, input: &str) -> Result<T, ValidationError>
[src]
pub fn format_for_editing(&self, value: &T) -> String
[src]
Auto Trait Implementations
impl<T> !RefUnwindSafe for ParseFormatter<T>
[src]
impl<T> !Send for ParseFormatter<T>
[src]
impl<T> !Sync for ParseFormatter<T>
[src]
impl<T> Unpin for ParseFormatter<T>
[src]
impl<T> !UnwindSafe for ParseFormatter<T>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub 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> RoundFrom<T> for T
pub fn round_from(x: T) -> T
impl<T, U> RoundInto<U> for T where
U: RoundFrom<T>,
U: RoundFrom<T>,
pub fn round_into(self) -> U
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub 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>,