pub struct EntryFilter<'a, FN: 'a, T: 'a> where
    FN: FnMut(&Entry, Option<&T>, char, i32) -> char
{ /* private fields */ }
Expand description

A callback used to filter text entered into an Entry component.

The function or closure associated with the callback should be defined as follows:

fn(entry: &Entry, data: Option<&T>, ch: char, cursor_pos: i32) -> char

  • entry - The Entry being filtered.
  • data - The optional user data provided.
  • ch - The character entered into the Entry.
  • cursor_pos - The current cursor position in the Entry.

The function should return the character to be entered into the Entry field or ‘\0’ to ignore the entered character.

See the example under Entry.

Implementations

Create a new EntryFilter.

Creates a new EntryFilter associated with the Entry entry. The function function will be called for each character entered.

  • entry - The Entry to associate with the callback.
  • data - The optonal user data to pass to the function.
  • function - The function or closure to be called when a character is entered.
source

pub fn add_entry(&mut self, entry: &'a Entry, data: Option<T>)

Associate another Entry with the EntryFilter.

  • entry - The Entry to associate with the callback.
  • data - The optonal user data to pass to the function.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.