Enum kas::event::Response [−][src]
Expand description
Response type from Handler::handle
.
This type wraps Handler::Msg
allowing both custom messages and toolkit
messages.
Variants
Nothing of external interest
This implies that the event was consumed, but does not affect parents. Note that we consider “view changes” (i.e. scrolling) to not be of external interest.
Unhandled event
Indicates that the event was not consumed. An ancestor or the event manager is thus able to make use of this event.
Pan(Offset)
Pan scrollable regions by the given delta
With the usual scroll offset conventions, this delta must be subtracted from the scroll offset.
Tuple Fields of Pan
0: Offset
Focus(Rect)
(Keyboard) focus has changed. This region should be made visible.
Tuple Fields of Focus
0: Rect
Widget wishes to be selected (or have selection status toggled)
Notify of update to widget’s data
Widgets which hold editable data should return either this or
Response::Msg
on handling events which update that data.
Note: scrolling/adjusting a view is not considered a data update.
Custom message type
This signals a (possible) update to the widget’s data, while passing a data payload to the parent widget.
Implementations
Construct None
or Msg(msg)
Construct Update
or Msg(msg)
True if variant is Unhandled
Map from one Response
type to another
Once Rust supports specialisation, this will likely be replaced with a
From
implementation.
Map one Response
type into another
Once Rust supports specialisation, this will likely be redundant.
Try mapping from one Response
type to another, failing on Msg
variant and returning the payload.
Trait Implementations
Auto Trait Implementations
impl<M> RefUnwindSafe for Response<M> where
M: RefUnwindSafe,
impl<M> UnwindSafe for Response<M> where
M: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn cast_trunc(self) -> T
pub fn cast_trunc(self) -> T
Cast to integer, truncating Read more
pub fn cast_nearest(self) -> T
pub fn cast_nearest(self) -> T
Cast to the nearest integer Read more
pub fn cast_floor(self) -> T
pub fn cast_floor(self) -> T
Cast the floor to an integer Read more
pub fn try_cast_trunc(self) -> Result<T, Error>
pub fn try_cast_trunc(self) -> Result<T, Error>
Try converting to integer with truncation Read more
pub fn try_cast_nearest(self) -> Result<T, Error>
pub fn try_cast_nearest(self) -> Result<T, Error>
Try converting to the nearest integer Read more
pub fn try_cast_floor(self) -> Result<T, Error>
pub fn try_cast_floor(self) -> Result<T, Error>
Try converting the floor to an integer Read more
pub fn try_cast_ceil(self) -> Result<T, Error>
pub fn try_cast_ceil(self) -> Result<T, Error>
Try convert the ceiling to an integer Read more