[][src]Struct druid::win_handler::DruidHandler

pub struct DruidHandler<T: Data + 'static + Default> {
    pub window_id: WindowId,
    pub phantom: PhantomData<T>,
}

The struct implements the druid-shell WinHandler trait.

One DruidHandler exists per window.

This is something of an internal detail and possibly we don't want to surface it publicly.

Fields

window_id: WindowId

The shared app state. The id for the current window.

phantom: PhantomData<T>

Methods

impl<T: Data + 'static + Default> DruidHandler<T>[src]

pub(crate) fn new_shared(window_id: WindowId) -> DruidHandler<T>[src]

Note: the root widget doesn't go in here, because it gets added to the app state.

fn do_event(&mut self, event: Event, win_ctx: &mut dyn WinCtx) -> bool[src]

Send an event to the widget hierarchy.

Returns true if the event produced an action.

This is principally because in certain cases (such as keydown on Windows) the OS needs to know if an event was handled.

Trait Implementations

impl<T: Clone + Data + 'static + Default> Clone for DruidHandler<T>[src]

impl<T: Default + Data + 'static> Default for DruidHandler<T>[src]

impl<T: Data + 'static + Default> WinHandler<DruidHandler<T>> for DruidHandler<T>[src]

Auto Trait Implementations

impl<T> Send for DruidHandler<T> where
    T: Send

impl<T> Sync for DruidHandler<T> where
    T: Sync

impl<T> Unpin for DruidHandler<T> where
    T: Unpin

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

impl<T, U> RoundInto<U> for T where
    U: RoundFrom<T>, 
[src]

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

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.