pub struct RenderHandle { /* private fields */ }Expand description
A handle for requesting renders from any thread.
This is a cloneable, thread-safe handle that can be used to trigger re-renders from background threads or async tasks.
§Example
ⓘ
use std::thread;
use rnk::render_handle;
let handle = render_handle().expect("App must be running");
thread::spawn(move || {
// ... do some work ...
handle.request_render();
});Implementations§
Source§impl RenderHandle
impl RenderHandle
Sourcepub fn request_render(&self)
pub fn request_render(&self)
Request a re-render
Sourcepub fn println(&self, message: impl IntoPrintable)
pub fn println(&self, message: impl IntoPrintable)
Print a message that persists above the UI
Sourcepub fn enter_alt_screen(&self)
pub fn enter_alt_screen(&self)
Request to enter fullscreen mode
Sourcepub fn exit_alt_screen(&self)
pub fn exit_alt_screen(&self)
Request to exit fullscreen mode
Sourcepub fn is_alt_screen(&self) -> bool
pub fn is_alt_screen(&self) -> bool
Check if currently in fullscreen mode
Trait Implementations§
Source§impl Clone for RenderHandle
impl Clone for RenderHandle
Source§fn clone(&self) -> RenderHandle
fn clone(&self) -> RenderHandle
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RenderHandle
impl !RefUnwindSafe for RenderHandle
impl Send for RenderHandle
impl Sync for RenderHandle
impl Unpin for RenderHandle
impl !UnwindSafe for RenderHandle
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
Mutably borrows from an owned value. Read more