[][src]Struct unsegen::input::NavigateBehavior

pub struct NavigateBehavior<'a, N: Navigatable + 'a> { /* fields omitted */ }

Collection of triggers for functions of something Navigatable implementing Behavior.

Implementations

impl<'a, N: Navigatable + 'a> NavigateBehavior<'a, N>[src]

pub fn new(navigatable: &'a mut N) -> Self[src]

Create the behavior to act on the provided Navigatable. Add triggers using other functions!

pub fn up_on<E: ToEvent>(self, event: E) -> Self[src]

Make the behavior trigger the move_up function on the provided event.

A typical candidate for event would be Key::Up.

pub fn down_on<E: ToEvent>(self, event: E) -> Self[src]

Make the behavior trigger the move_down function on the provided event.

A typical candidate for event would be Key::Down.

pub fn left_on<E: ToEvent>(self, event: E) -> Self[src]

Make the behavior trigger the move_left function on the provided event.

A typical candidate for event would be Key::Left.

pub fn right_on<E: ToEvent>(self, event: E) -> Self[src]

Make the behavior trigger the move_right function on the provided event.

A typical candidate for event would be Key::Right.

Trait Implementations

impl<'a, N: Navigatable + 'a> Behavior for NavigateBehavior<'a, N>[src]

Auto Trait Implementations

impl<'a, N> RefUnwindSafe for NavigateBehavior<'a, N> where
    N: RefUnwindSafe

impl<'a, N> Send for NavigateBehavior<'a, N> where
    N: Send

impl<'a, N> Sync for NavigateBehavior<'a, N> where
    N: Sync

impl<'a, N> Unpin for NavigateBehavior<'a, N>

impl<'a, N> !UnwindSafe for NavigateBehavior<'a, N>

Blanket Implementations

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

impl<F> Behavior for F where
    F: FnOnce(Input) -> Option<Input>, 
[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, 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.