pub struct PrepareResult {
pub needs_redraw: bool,
pub next_redraw_in: Option<Duration>,
pub next_layout_redraw_in: Option<Duration>,
pub next_paint_redraw_in: Option<Duration>,
pub timings: PrepareTimings,
}Expand description
Reported back from each backend’s prepare(...) per frame.
Two redraw deadlines:
Self::next_layout_redraw_in— the next frame that needs a full rebuild + layout pass. Driven by widgetcrate::tree::El::redraw_withinrequests, animations still settling, and pending tooltip / toast fades. The host must call the backend’s fullprepare(...)(build → layout → paint → render) when this elapses.Self::next_paint_redraw_in— the next frame a time-driven shader needs but layout state is unchanged (e.g. spinner / skeleton / progress-indeterminate /samples_time=truecustom shaders). The host can call the backend’s lighterrepaint(...)path which reuses the cachedDrawOplist, advancesframe.time, and skips rebuild + layout. Skipping the layout path is only safe when no input has been processed since the last full prepare; hosts must upgrade to the full path on any input event.
Legacy aggregates Self::needs_redraw and Self::next_redraw_in
fold both lanes (OR / min) for hosts that don’t want to split paths.
Fields§
§needs_redraw: boolLegacy “any redraw needed?” — OR of next_layout_redraw_in.is_some()
and next_paint_redraw_in.is_some(), plus animation-settling /
tooltip-pending bools the runtime tracks internally.
next_redraw_in: Option<Duration>Legacy combined deadline — min(next_layout_redraw_in, next_paint_redraw_in). Hosts that don’t distinguish layout
from paint-only redraws can keep reading this.
next_layout_redraw_in: Option<Duration>Tightest deadline among signals that need a full rebuild +
layout: widget redraw_within, animations still settling,
tooltip / toast pending. Some(ZERO) for “now.”
next_paint_redraw_in: Option<Duration>Tightest deadline among time-driven shaders. The host can
service this with a paint-only frame (reuse cached ops, just
advance frame.time). Some(ZERO) for “every frame” (the
default for is_continuous() shaders today).
timings: PrepareTimingsTrait Implementations§
Source§impl Clone for PrepareResult
impl Clone for PrepareResult
Source§fn clone(&self) -> PrepareResult
fn clone(&self) -> PrepareResult
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 PrepareResult
impl Debug for PrepareResult
Source§impl Default for PrepareResult
impl Default for PrepareResult
Source§fn default() -> PrepareResult
fn default() -> PrepareResult
impl Copy for PrepareResult
Auto Trait Implementations§
impl Freeze for PrepareResult
impl RefUnwindSafe for PrepareResult
impl Send for PrepareResult
impl Sync for PrepareResult
impl Unpin for PrepareResult
impl UnsafeUnpin for PrepareResult
impl UnwindSafe for PrepareResult
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.