Skip to main content

FrameCause

Struct FrameCause 

Source
pub struct FrameCause(/* private fields */);
Expand description

Why a frame was drawn: every reason that reached the window between the start of the last frame and the start of this one. Read from a view as Core::frame_cause. A set, because a frame answers everything that asked since the last one — a keystroke and the caret’s blink, a wheel and the transition it started.

Empty is a frame nobody here asked for: the platform’s own redraw (an expose, a live resize the OS paints through), or a driver that notes nothing.

Implementations§

Source§

impl FrameCause

Source

pub const NONE: FrameCause

Nothing recorded.

Source

pub const POINTER_MOVE: FrameCause

The pointer moved over the window.

Source

pub const POINTER_LEAVE: FrameCause

The pointer left the window.

Source

pub const BUTTON: FrameCause

A mouse button went down or up, or a force click.

Source

pub const WHEEL: FrameCause

A wheel or a trackpad scroll — a swipe’s momentum included, which the platform sends as scrolls after the hand has left.

Source

pub const KEY: FrameCause

A key went down or up.

Source

pub const MODIFIERS: FrameCause

The modifier keys changed.

Source

pub const TEXT: FrameCause

Text arrived: typed, committed by an input method, or pasted.

Source

pub const PREEDIT: FrameCause

An input method’s composition changed.

Source

pub const ACCESS: FrameCause

Assistive technology asked for an action.

Source

pub const FILE_DRAG: FrameCause

Files dragged over the window, dropped on it, or taken away.

Source

pub const FILES: FrameCause

A file dialog answered, or the OS handed the app documents to open (InputEvent::Open, backlog F124).

Source

pub const FIRST: FrameCause

The window’s first frame.

Source

pub const WAKE: FrameCause

The app woke the loop from another thread (a Waker).

Source

pub const HOST: FrameCause

The host asked for a frame: a pumped runner’s request_redraw, a new view handed over.

Source

pub const RESIZE: FrameCause

The window changed size.

Source

pub const SCALE: FrameCause

The window moved to a display of another scale.

Source

pub const FOCUS: FrameCause

The window gained or lost the keyboard.

Source

pub const OCCLUSION: FrameCause

The window was uncovered, or came back from minimized. The runner leaves out of that frame what it noted while the window could not draw and no frame took — another window’s input, an appearance change — so a restore does not report reasons from long before; resize is the same edge on Windows, where restoring is a resize.

Source

pub const APPEARANCE: FrameCause

The system’s appearance or settings changed: light or dark, the accent, reduced motion, assistive technology coming or going, a font installed or removed.

Source

pub const CARET: FrameCause

The caret’s blink changed phase.

Source

pub const RETRY: FrameCause

The last frame’s surface refused it (skipped, out of date, misconfigured) and the frame is tried again.

Source

pub const OVERDUE: FrameCause

A frame held for the display waited too long and is drawn anyway.

Source

pub const DEVICE: FrameCause

The graphics device was reopened.

Source

pub const AFTER_FRAME: FrameCause

The last frame’s own events — a resize, what a new layout put under a still pointer — were routed after it, and answered.

Source

pub const ELSEWHERE: FrameCause

Something that reached the app in another window, which can change what this one shows.

Source

pub const MENU: FrameCause

A menu (the platform’s context menu or menu bar) was answered.

Source

pub const AUDIO: FrameCause

A sound finished or was refused, and its event was routed.

Source

pub const SMOKE: FrameCause

A smoke run’s frame counter asked for the next frame.

Source

pub const OWED: FrameCause

The last frame left one owed (Core::owed); Core::owed_by says who, when traced.

Source

pub const ALL: [(FrameCause, &'static str); 29]

Each reason and its name, in bit order.

Source

pub const fn bits(self) -> u32

The bits, for a binding or a log.

Source

pub const fn from_bits(bits: u32) -> FrameCause

The set these bits spell; bits no reason has are dropped.

Source

pub const fn is_empty(self) -> bool

Source

pub const fn contains(self, other: FrameCause) -> bool

Whether every reason in other is in this set.

Source

pub const fn intersects(self, other: FrameCause) -> bool

Whether any reason in other is in this set.

Source

pub const fn union(self, other: FrameCause) -> FrameCause

Source

pub fn names(self) -> impl Iterator<Item = &'static str>

The names of the reasons in the set, in bit order.

Source

pub fn of_input(ev: &InputEvent) -> FrameCause

The reason one input is: what Core::handle_input records, and what a driver that screens input before the core sees it can note for an event it keeps.

Trait Implementations§

Source§

impl BitOr for FrameCause

Source§

type Output = FrameCause

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: FrameCause) -> FrameCause

Performs the | operation. Read more
Source§

impl BitOrAssign for FrameCause

Source§

fn bitor_assign(&mut self, rhs: FrameCause)

Performs the |= operation. Read more
Source§

impl Clone for FrameCause

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 Copy for FrameCause

Source§

impl Debug for FrameCause

Source§

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

FrameCause(key|caret), FrameCause() when empty.

Source§

impl Default for FrameCause

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for FrameCause

Source§

impl Hash for FrameCause

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for FrameCause

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 StructuralPartialEq for FrameCause

Auto Trait Implementations§

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.