Skip to main content

InputType

Trait InputType 

Source
pub trait InputType:
    Clone
    + PartialEq
    + 'static {
    // Required methods
    fn as_text(&self) -> Cow<'_, str>;
    fn from_text(text: &str) -> Option<Self>;
}
Expand description

Value type that an Input can edit through its text representation.

Required Methods§

Source

fn as_text(&self) -> Cow<'_, str>

Text representation of the value.

Source

fn from_text(text: &str) -> Option<Self>

Parse the text back into a value, None if the text is not valid.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl InputType for f32

Source§

fn as_text(&self) -> Cow<'_, str>

Source§

fn from_text(text: &str) -> Option<Self>

Source§

impl InputType for f64

Source§

fn as_text(&self) -> Cow<'_, str>

Source§

fn from_text(text: &str) -> Option<Self>

Source§

impl InputType for i8

Source§

fn as_text(&self) -> Cow<'_, str>

Source§

fn from_text(text: &str) -> Option<Self>

Source§

impl InputType for i16

Source§

fn as_text(&self) -> Cow<'_, str>

Source§

fn from_text(text: &str) -> Option<Self>

Source§

impl InputType for i32

Source§

fn as_text(&self) -> Cow<'_, str>

Source§

fn from_text(text: &str) -> Option<Self>

Source§

impl InputType for i64

Source§

fn as_text(&self) -> Cow<'_, str>

Source§

fn from_text(text: &str) -> Option<Self>

Source§

impl InputType for i128

Source§

fn as_text(&self) -> Cow<'_, str>

Source§

fn from_text(text: &str) -> Option<Self>

Source§

impl InputType for isize

Source§

fn as_text(&self) -> Cow<'_, str>

Source§

fn from_text(text: &str) -> Option<Self>

Source§

impl InputType for u8

Source§

fn as_text(&self) -> Cow<'_, str>

Source§

fn from_text(text: &str) -> Option<Self>

Source§

impl InputType for u16

Source§

fn as_text(&self) -> Cow<'_, str>

Source§

fn from_text(text: &str) -> Option<Self>

Source§

impl InputType for u32

Source§

fn as_text(&self) -> Cow<'_, str>

Source§

fn from_text(text: &str) -> Option<Self>

Source§

impl InputType for u64

Source§

fn as_text(&self) -> Cow<'_, str>

Source§

fn from_text(text: &str) -> Option<Self>

Source§

impl InputType for u128

Source§

fn as_text(&self) -> Cow<'_, str>

Source§

fn from_text(text: &str) -> Option<Self>

Source§

impl InputType for usize

Source§

fn as_text(&self) -> Cow<'_, str>

Source§

fn from_text(text: &str) -> Option<Self>

Source§

impl InputType for String

Source§

fn as_text(&self) -> Cow<'_, str>

Source§

fn from_text(text: &str) -> Option<Self>

Implementors§