[][src]Enum kas::event::Response

#[must_use]pub enum Response<M> {
    None,
    Unhandled(Event),
    Focus(Rect),
    Msg(M),
}

Response type from Handler::handle.

This type wraps Handler::Msg allowing both custom messages and toolkit messages.

Variants

None

No action

Unhandled(Event)

Unhandled input events get returned back up the widget tree

Focus(Rect)

(Keyboard) focus has changed. This region should be made visible.

Msg(M)

Custom message type

Implementations

impl<M> Response<M>[src]

pub fn is_none(&self) -> bool[src]

True if variant is None

pub fn is_unhandled(&self) -> bool[src]

True if variant is Unhandled

pub fn is_msg(&self) -> bool[src]

True if variant is Msg

pub fn from<N>(r: Response<N>) -> Self where
    M: From<N>, 
[src]

Map from one Response type to another

Once Rust supports specialisation, this will likely be replaced with a From implementation.

pub fn into<N>(self) -> Response<N> where
    N: From<M>, 
[src]

Map one Response type into another

Once Rust supports specialisation, this will likely be redundant.

pub fn try_from<N>(r: Response<N>) -> Result<Self, N>[src]

Try mapping from one Response type to another, failing on Msg variant and returning the payload.

pub fn try_into<N>(self) -> Result<Response<N>, M>[src]

Try mapping one Response type into another, failing on Msg variant and returning the payload.

impl Response<VoidMsg>[src]

pub fn void_into<M>(self) -> Response<M>[src]

Convert a Response<VoidMsg> to another Response

Trait Implementations

impl<M: Clone> Clone for Response<M>[src]

impl<M: Debug> Debug for Response<M>[src]

impl<M> From<M> for Response<M>[src]

impl<M> From<Option<M>> for Response<M>[src]

Auto Trait Implementations

impl<M> RefUnwindSafe for Response<M> where
    M: RefUnwindSafe

impl<M> Send for Response<M> where
    M: Send

impl<M> Sync for Response<M> where
    M: Sync

impl<M> Unpin for Response<M> where
    M: Unpin

impl<M> UnwindSafe for Response<M> where
    M: UnwindSafe

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<!> for T[src]

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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.