#[repr(C)]pub enum RelayoutReason {
Initial = 0,
RefreshDom = 1,
Resize = 2,
ThemeChange = 3,
RouteChange = 4,
Other = 5,
}Expand description
What triggered the current layout() invocation.
The framework re-invokes the layout callback for any change that may
produce a structurally different DOM (resize across a CSS breakpoint,
theme toggle, route switch, callback returning Update::RefreshDom).
LayoutCallbackInfo::relayout_reason() exposes which trigger this
particular call corresponds to so the callback can branch — for
example, skip expensive analytics on Resize calls.
Variants§
Initial = 0
First layout call for this window.
RefreshDom = 1
A user callback returned Update::RefreshDom.
Resize = 2
Window size changed across a CSS breakpoint or DPI scale change.
The callback can branch on info.window_width_* to emit a
different tree (e.g. hamburger menu vs sidebar).
ThemeChange = 3
System theme changed (light/dark).
RouteChange = 4
CallbackInfo::switch_route or set_route_param produced a new
route match. The callback should branch on
info.get_active_route().
Other = 5
Catch-all for relayouts that don’t fit one of the above categories.
Trait Implementations§
Source§impl Clone for RelayoutReason
impl Clone for RelayoutReason
Source§fn clone(&self) -> RelayoutReason
fn clone(&self) -> RelayoutReason
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RelayoutReason
impl Debug for RelayoutReason
Source§impl Default for RelayoutReason
impl Default for RelayoutReason
Source§impl Hash for RelayoutReason
impl Hash for RelayoutReason
Source§impl Ord for RelayoutReason
impl Ord for RelayoutReason
Source§fn cmp(&self, other: &RelayoutReason) -> Ordering
fn cmp(&self, other: &RelayoutReason) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for RelayoutReason
impl PartialEq for RelayoutReason
Source§fn eq(&self, other: &RelayoutReason) -> bool
fn eq(&self, other: &RelayoutReason) -> bool
self and other values to be equal, and is used by ==.