[][src]Struct glerminal::menu_systems::Filter

pub struct Filter { /* fields omitted */ }

Represents a HashMap from VirtualKeyCode to character. Used to filter out which characters get registered by the textinput.

Use Filter::empty_filter() to create a new filter and for example .with_basic_latin_characters to add basic latin characters to the filter.
Use .with_pair or insert to create your own filters.

Methods

impl Filter
[src]

pub fn empty_filter() -> Filter
[src]

Create an empty filter, where other filters can be added, such as basic_latin_keycode_filter

pub fn with_basic_latin_characters(self) -> Filter
[src]

Creates a Filter with basic latin characters

Includes characters a-z and spacebar.

pub fn with_basic_numerals(self) -> Filter
[src]

Creates a Filter with basic numerals

Includes numerals from 0-9

pub fn with_basic_special_symbols(self) -> Filter
[src]

Creates a Filter with basic special symbols

Includes ', \, :, ., ;, ,, =, -, *, _, /, [, ]

Unfortunately VirtualKeyCode doesn't seem to support other special characters currently.

pub fn with_pair(self, keycode: VirtualKeyCode, character: char) -> Filter
[src]

Add a specific VirtualKeyCode: char pair to this filter and return the current filter.

This would mean that when you press the keycode, the character specified will be typed.

pub fn insert(&mut self, keycode: VirtualKeyCode, character: char)
[src]

Insert a specific VirtualKeyCode: char pair to this filter.

Works similarly to with_pair

pub fn get(&self, keycode: &VirtualKeyCode) -> Option<&char>
[src]

Get the character from the specified VirtualKeyCode, None if it doesn't exist.

Trait Implementations

impl Clone for Filter
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Filter
[src]

Auto Trait Implementations

impl Send for Filter

impl Sync for Filter

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]