Skip to main content

InputType

Trait InputType 

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§

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

Text representation of the value.

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§

§

impl InputType for f32

§

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

§

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

§

impl InputType for f64

§

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

§

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

§

impl InputType for i8

§

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

§

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

§

impl InputType for i16

§

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

§

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

§

impl InputType for i32

§

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

§

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

§

impl InputType for i64

§

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

§

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

§

impl InputType for i128

§

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

§

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

§

impl InputType for isize

§

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

§

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

§

impl InputType for u8

§

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

§

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

§

impl InputType for u16

§

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

§

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

§

impl InputType for u32

§

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

§

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

§

impl InputType for u64

§

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

§

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

§

impl InputType for u128

§

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

§

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

§

impl InputType for usize

§

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

§

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

§

impl InputType for String

§

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

§

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

Implementors§