pub struct Handle<S: Spec> { /* private fields */ }Expand description
The app’s door into on-screen state (design §6.1).
Cheap to clone, Send + Sync when the spec’s vocabularies are (given
by Spec). Produced by Runtime::new; the
app hands clones to whatever threads need them.
Implementations§
Source§impl<S: Spec> Handle<S>
impl<S: Spec> Handle<S>
Sourcepub fn dispatch(&self, cmd: AppCommand<S>) -> Result<(), HandleError>
pub fn dispatch(&self, cmd: AppCommand<S>) -> Result<(), HandleError>
Enqueue a visual command and wake the loop. Never blocks; a full
inbox surfaces as HandleError::Full, a dead runtime as
HandleError::Closed.
Sourcepub fn request_repaint(&self, win: WindowId) -> Result<(), HandleError>
pub fn request_repaint(&self, win: WindowId) -> Result<(), HandleError>
Ask for a repaint of win from outside a hook (network data,
background work): an AppCommand::Cadence invalidate plus a wake.
The host then paints on demand instead of polling every frame.
Sourcepub fn snapshot(&self) -> Arc<VisualSnapshot<S>> ⓘ
pub fn snapshot(&self) -> Arc<VisualSnapshot<S>> ⓘ
The last published snapshot: lock-free, at most one tick old.
Trait Implementations§
Auto Trait Implementations§
impl<S> !RefUnwindSafe for Handle<S>
impl<S> !UnwindSafe for Handle<S>
impl<S> Forget for Handle<S>
impl<S> Freeze for Handle<S>
impl<S> Send for Handle<S>
impl<S> Sync for Handle<S>
impl<S> Unpin for Handle<S>
impl<S> UnsafeUnpin for Handle<S>
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