Struct KeyboardEventDetector

Source
pub struct KeyboardEventDetector<W: Widget, F: Fn(KeyEvent)> {
    pub on_event: F,
    pub child: W,
}

Fields§

§on_event: F§child: W

Trait Implementations§

Source§

impl<W: Widget, F: Fn(KeyEvent)> CheapEq for KeyboardEventDetector<W, F>

Source§

const CHEAP_TO_EQ: bool = false

This associated type is used to avoid recursive comparisons of the whole widget subtree (if one of the fields is itself a widget).
Source§

fn cheap_eq(&self, other: &Self) -> bool

Source§

impl<W: Widget, F: Fn(KeyEvent)> ViewWidget for KeyboardEventDetector<W, F>

Source§

fn build<'w>(&'w self, _: BuildContext<'w, Self>) -> Self::Widget<'w>

Source§

impl<W: Widget, F: Fn(KeyEvent)> Widget for KeyboardEventDetector<W, F>

Source§

fn unique_type(&self) -> TypeId

Implementation should return the same unique TypeId for given structure definition, even if that structure contains generic parameters. This is used to preserve state between generic widgets.
Source§

fn kind<'frui>(&'frui self) -> WidgetKind<'_>

Source§

impl<W: Widget, F: Fn(KeyEvent)> WidgetDerive for KeyboardEventDetector<W, F>

Source§

type Widget<'frui> = impl Widget + 'frui where Self: 'frui

Assuming this trait was derived through #[derive(WidgetKind)] this associated type should be derived automatically by the compiler. This requires that TAIT feature is enabled.
Source§

impl<W: Widget, F: Fn(KeyEvent)> WidgetState for KeyboardEventDetector<W, F>

Source§

type State = Option<CallbackKey>

Source§

fn create_state<'a>(&'a self) -> Self::State

Source§

fn mount(&self, ctx: BuildContext<'_, Self>)

Called when the widget is mounted into the tree (before build). Read more
Source§

fn unmount(&self, ctx: BuildContext<'_, Self>)

Called when the widget is unmounted from the tree. At this point given widget may be dropped or mounted again with its configuration updated. Read more

Auto Trait Implementations§

§

impl<W, F> Freeze for KeyboardEventDetector<W, F>
where F: Freeze, W: Freeze,

§

impl<W, F> Immutable for KeyboardEventDetector<W, F>
where F: Immutable, W: Immutable,

§

impl<W, F> RefUnwindSafe for KeyboardEventDetector<W, F>

§

impl<W, F> Send for KeyboardEventDetector<W, F>
where F: Send, W: Send,

§

impl<W, F> Sync for KeyboardEventDetector<W, F>
where F: Sync, W: Sync,

§

impl<W, F> Unpin for KeyboardEventDetector<W, F>
where F: Unpin, W: Unpin,

§

impl<W, F> UnwindSafe for KeyboardEventDetector<W, F>
where F: UnwindSafe, W: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> BoxedWidget for T
where T: Widget,

Source§

fn boxed<'a>(self) -> Box<dyn Widget + 'a>
where T: 'a,

Convenience method used to type erase and box a widget.
Source§

impl<T> CheapEq for T
where T: ?Sized,

Source§

const CHEAP_TO_EQ: bool = false

This associated type is used to avoid recursive comparisons of the whole widget subtree (if one of the fields is itself a widget).
Source§

default fn cheap_eq(&self, _: &T) -> bool

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> RoundFrom<T> for T

Source§

fn round_from(x: T) -> T

Source§

impl<T, U> RoundInto<U> for T
where U: RoundFrom<T>,

Source§

fn round_into(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WidgetDebug for T

Source§

default fn debug_name(&self) -> &'static str

Source§

fn debug_name_short(&self) -> &'static str

Source§

impl<T> WidgetLocalKey for T

Source§

default fn local_key(&self) -> Option<LocalKeyAny<'_>>

Source§

impl<T> WidgetUniqueType for T

Source§

default fn unique_type(&self) -> TypeId

Source§

impl<T> WidgetUniqueType for T
where T: Widget,