Byte Engine Docs
View on docs.rs

waker

Generated Rust API reference for byte_engine.

byte_engine / application / waker


Module waker

Wakes the application loop while it waits for window events.

With render-on-demand, an idle graphics application waits inside the platform event queue. State that changes without a window event must end that wait through the application's LoopWaker: UI tasks woken by other threads, inspector requests, and application worker threads.

Quick Reference

ItemKindDescription
LoopWakerstructThe LoopWaker struct makes a waiting application loop run its next tick.

Structs

LoopWaker

struct LoopWaker();

Defined in crates/byte-engine/src/application/waker.rs:19

The LoopWaker struct makes a waiting application loop run its next tick.

Take one with GraphicsApplication::waker, hand it to whatever changes state the loop cannot observe through window events, and call Self::wake from any thread afterwards. Wakes are coalesced, and waking a loop that is not waiting only costs two atomic operations. A LoopWaker also converts into a std::task::Waker for futures that must run inside the loop's own tick.

Implementations

  • fn wake(&self)

    Makes the application loop run its next tick without waiting for an event.

Trait Implementations

impl ArchivePointee for LoopWaker
  • type ArchivedMetadata = ()
  • fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for LoopWaker
impl Clone for LoopWaker
  • fn clone(&self) -> LoopWaker

    Related: LoopWaker

impl Default for LoopWaker
  • fn default() -> LoopWaker

    Related: LoopWaker

impl Downcast for LoopWaker
  • fn into_any(self: Box<T>) -> Box<dyn Any>
  • fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
  • fn as_any(&self) -> &dyn Any
  • fn as_any_mut(&mut self) -> &mut dyn Any
impl DowncastSync for LoopWaker
  • fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Instrument for LoopWaker
impl LayoutRaw for LoopWaker
  • fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for LoopWaker
  • unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
  • fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl Pointee for LoopWaker
  • type Metadata = ()
impl Read for LoopWaker
impl<R> ReadPrimitive for LoopWaker
impl WithSubscriber for LoopWaker

On this page