Skip to main content

InputMask

Trait InputMask 

Source
pub trait InputMask: 'static {
    // Required method
    fn correct(
        &self,
        was: &str,
        cursor: usize,
        now: &mut String,
        new_cursor: &mut usize,
    );
}
Expand description

A hook that can normalize a text edit before it is committed.

Required Methods§

Source

fn correct( &self, was: &str, cursor: usize, now: &mut String, new_cursor: &mut usize, )

Adjust the proposed text and caret position after an edit.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§