pub struct MainWake<W> { /* private fields */ }Expand description
The main window’s frame owed, and since when.
Implementations§
Source§impl<W: Copy + PartialEq> MainWake<W>
impl<W: Copy + PartialEq> MainWake<W>
pub fn new() -> Self
pub fn main(&self) -> Option<W>
Sourcepub fn set_counter(&mut self, counter: PassCounter)
pub fn set_counter(&mut self, counter: PassCounter)
Counts the passes of the application’s context
(PassCounter::install): the main window’s pay what is owed,
and a redraw that began none drew an immediate viewport
(MainWake::redraw).
Sourcepub fn redraw<R>(&mut self, window: W, run: impl FnOnce() -> R) -> R
pub fn redraw<R>(&mut self, window: W, run: impl FnOnce() -> R) -> R
Runs the system’s (or the loop’s) redraw of window (run:
handing RedrawRequested to eframe); with a counter, a redraw of
a window other than the main one that began no pass owes the main
window a frame.
Sourcepub fn set_enabled(&mut self, enabled: bool)
pub fn set_enabled(&mut self, enabled: bool)
Whether the loop paints the main window when its frame is owed too long (off where a present to a hidden window can block).
Sourcepub fn asked(&mut self, at: Instant)
pub fn asked(&mut self, at: Instant)
A repaint is asked of the main window, due at at: owed from
then, unless a frame is owed already.
Sourcepub fn redrawn(&mut self, window: W, own_pass: bool, now: Instant)
pub fn redrawn(&mut self, window: W, own_pass: bool, now: Instant)
A window’s redraw ran: window, with passes main-window passes
begun during it. A redraw of another window that began no pass of
its own (own_pass false: an immediate viewport, drawn by the
main window’s pass) owes the main window a frame.
Sourcepub fn main_passes(&mut self, passes: u64)
pub fn main_passes(&mut self, passes: u64)
The main window’s passes begun so far (PassCounter::main):
what was owed before the last of them is paid.
Source§impl<W: Copy + PartialEq> MainWake<W>
eframe’s side: its repaint request for the main window (the event
egui’s repaint callback sends to the loop) as eframe takes it, a
request outdated by a pass since being dropped.
impl<W: Copy + PartialEq> MainWake<W>
eframe’s side: its repaint request for the main window (the event egui’s repaint callback sends to the loop) as eframe takes it, a request outdated by a pass since being dropped.
Sourcepub fn user_event(&mut self, ctx: &Context, event: &UserEvent)
pub fn user_event(&mut self, ctx: &Context, event: &UserEvent)
Notes eframe’s UserEvent::RequestRepaint for the main window
(ctx: the application’s context). Call it before handing the
event to eframe.
Trait Implementations§
Auto Trait Implementations§
impl<W> Freeze for MainWake<W>where
W: Freeze,
impl<W> RefUnwindSafe for MainWake<W>where
W: RefUnwindSafe,
impl<W> Send for MainWake<W>where
W: Send,
impl<W> Sync for MainWake<W>where
W: Sync,
impl<W> Unpin for MainWake<W>where
W: Unpin,
impl<W> UnsafeUnpin for MainWake<W>where
W: UnsafeUnpin,
impl<W> UnwindSafe for MainWake<W>where
W: UnwindSafe,
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more