Skip to main content

PlayitExecutor

Struct PlayitExecutor 

Source
pub struct PlayitExecutor<T: PlayitTransport, const REC_CAP: usize = 256> { /* private fields */ }
Expand description

Processes playit commands arriving over a PlayitTransport and executes them against a WidgetNode tree.

The const generic REC_CAP sets the maximum number of events the built-in recorder can capture (default 256).

Call poll once per frame from your main loop.

Implementations§

Source§

impl<T: PlayitTransport, const REC_CAP: usize> PlayitExecutor<T, REC_CAP>

Source

pub fn new(transport: T) -> Self

Create a new executor wrapping the given transport.

Source

pub fn poll<P: EventPipeline, F>( &mut self, root: &mut WidgetNode, status: &StatusData, fb: Option<&dyn FramebufferReader>, pipeline: &mut P, on_extension: F, )
where F: FnMut(&[u8]),

Drain incoming bytes, parse complete command lines, and execute them.

  • root — mutable reference to the widget tree root.
  • status — current telemetry snapshot for ? commands.
  • fb — optional framebuffer reader for D pixel dump commands.
  • pipeline — event pipeline for gesture processing. Pass &mut NullPipeline for direct dispatch.
  • on_extension — callback for application-defined extension commands.
Source

pub fn poll_with_callback<P: EventPipeline, F, A>( &mut self, root: &mut WidgetNode, status: &StatusData, fb: Option<&dyn FramebufferReader>, pipeline: &mut P, on_extension: F, after_dispatch: A, )
where F: FnMut(&[u8]), A: FnMut(&Event),

Variant of poll that invokes after_dispatch after every event delivered to the widget tree.

Source

pub fn dispatch_event<P: EventPipeline, A>( &mut self, event: Event, root: &mut WidgetNode, pipeline: &mut P, after_dispatch: A, )
where A: FnMut(&Event),

Dispatch one runtime input event through the same gesture pipeline used for transport commands.

Auto Trait Implementations§

§

impl<T, const REC_CAP: usize> Freeze for PlayitExecutor<T, REC_CAP>
where T: Freeze,

§

impl<T, const REC_CAP: usize> RefUnwindSafe for PlayitExecutor<T, REC_CAP>
where T: RefUnwindSafe,

§

impl<T, const REC_CAP: usize> Send for PlayitExecutor<T, REC_CAP>
where T: Send,

§

impl<T, const REC_CAP: usize> Sync for PlayitExecutor<T, REC_CAP>
where T: Sync,

§

impl<T, const REC_CAP: usize> Unpin for PlayitExecutor<T, REC_CAP>
where T: Unpin,

§

impl<T, const REC_CAP: usize> UnsafeUnpin for PlayitExecutor<T, REC_CAP>
where T: UnsafeUnpin,

§

impl<T, const REC_CAP: usize> UnwindSafe for PlayitExecutor<T, REC_CAP>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.