Skip to main content

EventPayload

Enum EventPayload 

Source
pub enum EventPayload<'a> {
Show 17 variants Clicked, TextChanged(&'a str), TextSubmitted(&'a str), FocusLost, ProtocolError { code: u32, message: &'a str, }, KeyDown { key: Key, shift_key: bool, ctrl_key: bool, alt_key: bool, meta_key: bool, }, RangeRequested { start: u32, count: u32, }, ValueChanged(f64), WindowSizeChanged { width_dp: f32, height_dp: f32, class: WindowSizeClass, height_class: WindowHeightClass, }, FilesEntered, FilesDropped(&'a str), DesignSystemResolved(DesignSystem), Resync, LifecycleStart, LifecycleStop, NotificationActivated { action: u32, key: &'a str, }, NotificationPermissionChanged(NotificationPermission),
}

Variants§

§

Clicked

§

TextChanged(&'a str)

§

TextSubmitted(&'a str)

§

FocusLost

§

ProtocolError

Fields

§code: u32
§message: &'a str
§

KeyDown

Fields

§key: Key
§shift_key: bool
§ctrl_key: bool
§alt_key: bool
§meta_key: bool
§

RangeRequested

The Renderer asks the Host to materialise the visible item range.

Fields

§start: u32
§count: u32
§

ValueChanged(f64)

A control’s new value, in the widget’s own unit: an epoch count for a picker, a position for a slider, 0.0 or 1.0 for a toggle. The Renderer decided how the user reached it, so nothing about calendars, wheels, tracks or thumbs crosses here.

One f64 holds all of them: integers up to 2^53 survive it exactly, so splitting the event in two would only give the same concept two names.

§

WindowSizeChanged

The window, or one observed node, moved into a different size class. The Renderer measures it and sends this only when a class changes, never on every layout pass. A node_id of 0 is the window; anything else is the node that asked to be measured.

Fields

§width_dp: f32
§height_dp: f32
§height_class: WindowHeightClass
§

FilesEntered

Files are over a node that said it would take them. Nothing about what they are: the platforms disagree about what is knowable before a drop, and a screen that only needs to light up does not need to know.

§

FilesDropped(&'a str)

Files were let go over a node. The paths arrive together, separated by a byte no path on any of the three desktops may contain.

§

DesignSystemResolved(DesignSystem)

The Renderer resolved the theme and this is what it chose. Sent once and then only when the answer changes, the same way a size class is.

§

Resync

The Renderer lost its node table and asks for the whole tree again. A recreated Activity is the case that produces it.

§

LifecycleStart

The platform brought the UI back. Timers and animations resume.

§

LifecycleStop

The platform stopped the UI. Timers and animations are suppressed, so a process that is not on screen is not asked to draw.

§

NotificationActivated

The user pressed a notification the application posted. action is 0 for the body and 1 or 2 for an action button; key is the name the application gave it.

A name rather than a handler, because a notification outlives the component that posted it by hours and a callback dies with its scope.

Fields

§action: u32
§key: &'a str
§

NotificationPermissionChanged(NotificationPermission)

Whether notifications may be shown, sent once after start and then only when the answer changes.

Trait Implementations§

Source§

impl<'a> Clone for EventPayload<'a>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for EventPayload<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> PartialEq for EventPayload<'a>

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<'a> StructuralPartialEq for EventPayload<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for EventPayload<'a>

§

impl<'a> RefUnwindSafe for EventPayload<'a>

§

impl<'a> Send for EventPayload<'a>

§

impl<'a> Sync for EventPayload<'a>

§

impl<'a> Unpin for EventPayload<'a>

§

impl<'a> UnsafeUnpin for EventPayload<'a>

§

impl<'a> UnwindSafe for EventPayload<'a>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.