pub struct Frame<'a> { /* private fields */ }Expand description
The window an update is building, application-level window management, and shutdown.
update is called once per redraw of one window; window_key says
which, and the Context passed alongside is that window’s alone. Draw
each window’s content from your own data keyed by that window.
Implementations§
Source§impl<'a> Frame<'a>
impl<'a> Frame<'a>
Sourcepub fn window(&self) -> &Arc<Window> ⓘ
pub fn window(&self) -> &Arc<Window> ⓘ
Native window of this frame for changing the title, requesting redraws, or cloning its Arc into a background worker that needs to wake the sleeping event loop.
Sourcepub fn window_key(&self) -> &WindowKey
pub fn window_key(&self) -> &WindowKey
The key of the window being drawn: WindowKey::main in a single-window application.
Sourcepub fn info(&self) -> &WindowInfo
pub fn info(&self) -> &WindowInfo
Size, scale factor and state of this window at the start of the frame.
Sourcepub fn windows(&mut self) -> &mut Windows<'a>
pub fn windows(&mut self) -> &mut Windows<'a>
Open, close, focus and inspect other windows; see Windows.
Sourcepub fn open_window(
&mut self,
key: impl Into<WindowKey>,
options: WindowOptions,
) -> OpenOutcome
pub fn open_window( &mut self, key: impl Into<WindowKey>, options: WindowOptions, ) -> OpenOutcome
Ask for a secondary window; sugar for Windows::open.
Sourcepub fn close_window(&mut self, key: impl Into<WindowKey>)
pub fn close_window(&mut self, key: impl Into<WindowKey>)
Close one window now, without asking the application; see Windows::close.
Sourcepub fn close_this_window(&mut self)
pub fn close_this_window(&mut self)
Close this window now, without asking: the way to confirm a close you rejected.
Sourcepub fn request_close(&mut self)
pub fn request_close(&mut self)
Ask to close this window as the user would, so App::close_requested
decides. Use it for an in-window close button that must honour the same confirmation.
Sourcepub fn window_status(&self, key: &WindowKey) -> Option<&WindowStatus>
pub fn window_status(&self, key: &WindowKey) -> Option<&WindowStatus>
Where a requested window is, or None for a key that was never requested or has closed.
Sourcepub fn device_resets(&self) -> u64
pub fn device_resets(&self) -> u64
How many times the runner has recreated the GPU renderer after a lost device. Recovery is automatic and covers every window; compare with the previous value to notice it.
Sourcepub fn last_device_loss(&self) -> Option<&str>
pub fn last_device_loss(&self) -> Option<&str>
The reason the GPU device was last lost, if it ever was.
Sourcepub fn close(&mut self)
pub fn close(&mut self)
End the application after the current frame has been presented successfully,
closing every window. To close only this window use close_this_window.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Frame<'a>
impl<'a> !UnwindSafe for Frame<'a>
impl<'a> Freeze for Frame<'a>
impl<'a> Send for Frame<'a>
impl<'a> Sync for Frame<'a>
impl<'a> Unpin for Frame<'a>
impl<'a> UnsafeUnpin for Frame<'a>
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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.Source§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.Source§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.Source§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.