[][src]Struct keytokey::handlers::Layer

pub struct Layer<'a> { /* fields omitted */ }

A layer either rewrites a key to another one or outputs a string upon key release.

It does this for multiple mappings at once, and it can consider the shift state, which is very useful for unicode characters with lower and upper case.

Unfortunatly, Layers are memory inefficient, they keep their mapping in ram, and each mapping is at least 96 bits / 12 bytes.

Consider using a RewriteLayer instead if you don't need the string, Shift or Action functionality.

If AutoOff is set to anything but AutoOff::No, the layer will turn itself of after any key release (AutoOff::AfterAll), after a non-modifier-non-oneshot key release (AutoOff::AfterNonModifier), or after a successfull match AutoOff::AfterMatch

Implementations

impl<'_> Layer<'_>[src]

pub fn new<F: AcceptsKeycode>(
    rewrites: Vec<(F, LayerAction)>,
    auto_off: AutoOff
) -> Layer
[src]

Trait Implementations

impl<'_, T: USBKeyOut> ProcessKeys<T> for Layer<'_>[src]

Auto Trait Implementations

impl<'a> Send for Layer<'a>

impl<'a> Sync for Layer<'a>

impl<'a> Unpin for Layer<'a>

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.