pub struct AutomationQueue { /* private fields */ }Implementations§
Source§impl AutomationQueue
impl AutomationQueue
pub fn new() -> Arc<Self> ⓘ
Sourcepub fn attach(&self, ctx: &Context)
pub fn attach(&self, ctx: &Context)
Give the queue the egui context so a submit can wake an idle frame loop.
Sourcepub fn set_waker(&self, waker: Waker)
pub fn set_waker(&self, waker: Waker)
Install the app thread’s waker (the desktop event loop’s proxy). Work queued before it was installed is not stranded: the waker fires at once.
Sourcepub fn submit(&self, envelope: Envelope) -> Receiver<Reply>
pub fn submit(&self, envelope: Envelope) -> Receiver<Reply>
Enqueue a command. The reply arrives on the returned receiver once the app has reached the command’s phase (or at once, for an unknown command or a poisoned session).
Sourcepub fn submit_before(
&self,
envelope: Envelope,
deadline: Option<Instant>,
) -> Receiver<Reply>
pub fn submit_before( &self, envelope: Envelope, deadline: Option<Instant>, ) -> Receiver<Reply>
A deadline applies before dispatch, never to work already accepted by a handler.
Sourcepub fn withdraw(&self, id: u64) -> Withdrawn
pub fn withdraw(&self, id: u64) -> Withdrawn
The host stopped waiting for command id. A command still queued is
removed and answered as never dispatched; anything else was accepted.
Sourcepub fn has_frameless_work(&self) -> bool
pub fn has_frameless_work(&self) -> bool
Whether drain_frameless has anything to do:
a frame-free command at the head of the queue, or polled work.
Sourcepub fn push_notice(&self, kind: NoticeKind, text: impl Into<String>)
pub fn push_notice(&self, kind: NoticeKind, text: impl Into<String>)
Record something the session should know about — a toast the user would
have seen, a refusal, a panic. The app’s own toast lane feeds this every
frame (BrepApp::ui), so notices reports what was on screen.
Sourcepub fn take_notices(&self) -> Vec<Notice>
pub fn take_notices(&self) -> Vec<Notice>
Drain for the notices COMMAND: everything since the last drain. The
reply cursor goes back to the start with them — the buffer is empty, so
the reply this drain rides out on carries nothing twice.
pub fn pointer(&self) -> Pointer
pub fn frame(&self) -> u64
pub fn has_pending(&self) -> bool
Sourcepub fn is_polling(&self, id: u64) -> bool
pub fn is_polling(&self, id: u64) -> bool
Whether a command has started work the queue is polling (see
Outcome::Poll): a host keeps stepping frames for it past its usual
frame budget, since the work is advancing, not stuck.
Sourcepub fn poison(&self, why: impl Into<String>)
pub fn poison(&self, why: impl Into<String>)
Mark the session unusable (a panic unwound through the app). Every pending and future command is answered with the reason.
pub fn is_poisoned(&self) -> bool
Sourcepub fn drain_input(
&self,
raw: &mut RawInput,
frame: u64,
ppp: f32,
view: Option<Rect>,
ctx: &Context,
)
pub fn drain_input( &self, raw: &mut RawInput, frame: u64, ppp: f32, view: Option<Rect>, ctx: &Context, )
Phase 1 of the frame: apply input commands as egui::Events and
complete captures whose Event::Screenshot arrived. view is the
viewport rect of the last frame (for region: viewport crops).
ctx is the app’s: the pointer reads egui’s clock from it (the
headless host leaves raw.time unset, and egui adds predicted_dt),
and a click_gap resets its click history.
Sourcepub fn drain_app(&self, phase: Phase, ctx: &mut Ctx<'_>, frame: u64)
pub fn drain_app(&self, phase: Phase, ctx: &mut Ctx<'_>, frame: u64)
Phases 2 and 3 of the frame. Runs every pending command registered for
phase, in order.
Sourcepub fn drain_frameless(&self, ctx: &mut Ctx<'_>) -> bool
pub fn drain_frameless(&self, ctx: &mut Ctx<'_>) -> bool
Dispatch without a frame (the desktop loop’s service step): the
queue’s head, in FIFO order, up to the first command that needs a
frame (frameless); then one poll of the work they started. Returns
whether polled work is still outstanding. Runs on the app’s thread, so
mutations stay sequential with the UI’s own writers.
Sourcepub fn publish_view(&self, handle: &str, revision: u64)
pub fn publish_view(&self, handle: &str, revision: u64)
Record which document the frame just drawn shows (called at the end of every app frame), so a capture is bound to what it pictures.
Sourcepub fn next_token(&self) -> u64
pub fn next_token(&self) -> u64
A fresh token for a screenshot request.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for AutomationQueue
impl RefUnwindSafe for AutomationQueue
impl Send for AutomationQueue
impl Sync for AutomationQueue
impl Unpin for AutomationQueue
impl UnsafeUnpin for AutomationQueue
impl UnwindSafe for AutomationQueue
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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.