[−][src]Struct newt::callbacks::EntryFilter
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
- TheEntry
being filtered.data
- The optional user data provided.ch
- The character entered into theEntry
.cursor_pos
- The current cursor position in theEntry
.
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
impl<'a, FN: 'a, T: 'a> EntryFilter<'a, FN, T> where
FN: FnMut(&Entry, Option<&T>, char, i32) -> char,
[src]
FN: FnMut(&Entry, Option<&T>, char, i32) -> char,
pub fn new(
entry: &'a Entry,
function: FN,
data: Option<T>
) -> Box<EntryFilter<'a, FN, T>>
[src]
entry: &'a Entry,
function: FN,
data: Option<T>
) -> Box<EntryFilter<'a, FN, T>>
Create a new EntryFilter
.
Creates a new EntryFilter
associated with the Entry
entry
.
The function function
will be called for each character entered.
entry
- TheEntry
to associate with the callback.function
- The function or closure to be called when a character is entered.data
- The optonal user data to pass to the function.
pub fn add_entry(&mut self, entry: &'a Entry, data: Option<T>)
[src]
Associate another Entry
with the EntryFilter
.
entry
- TheEntry
to associate with the callback.data
- The optonal user data to pass to the function.
Auto Trait Implementations
impl<'a, FN, T> !RefUnwindSafe for EntryFilter<'a, FN, T>
impl<'a, FN, T> !Send for EntryFilter<'a, FN, T>
impl<'a, FN, T> !Sync for EntryFilter<'a, FN, T>
impl<'a, FN, T> Unpin for EntryFilter<'a, FN, T> where
FN: Unpin,
T: Unpin,
FN: Unpin,
T: Unpin,
impl<'a, FN, T> !UnwindSafe for EntryFilter<'a, FN, T>
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,
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, 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.
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>,