pub trait Document: Any + 'static {
// Required methods
fn inner(&self) -> DocGuard<'_>;
fn inner_mut(&mut self) -> DocGuardMut<'_>;
// Provided methods
fn handle_ui_event(&mut self, event: UiEvent) { ... }
fn poll(&mut self, task_context: Option<Context<'_>>) -> bool { ... }
fn poll_for_settle(
&mut self,
task_context: Option<Context<'_>>,
run_timers: bool,
) -> bool { ... }
fn id(&self) -> usize { ... }
}Expand description
Abstraction over wrappers around BaseDocument to allow for them all to
be driven by blitz-shell
Required Methods§
Provided Methods§
Sourcefn handle_ui_event(&mut self, event: UiEvent)
fn handle_ui_event(&mut self, event: UiEvent)
Sourcefn poll(&mut self, task_context: Option<Context<'_>>) -> bool
fn poll(&mut self, task_context: Option<Context<'_>>) -> bool
Poll any pending async operations, and flush changes to the underlying BaseDocument
Sourcefn poll_for_settle(
&mut self,
task_context: Option<Context<'_>>,
run_timers: bool,
) -> bool
fn poll_for_settle( &mut self, task_context: Option<Context<'_>>, run_timers: bool, ) -> bool
Drain immediate work for a host’s settle loop.
Pass run_timers = true only on the first pass to allow one batch of
due timer and animation callbacks. Subsequent passes must leave those
callbacks scheduled while draining scripts and microtasks.
Documents that execute timers must override this method. Wrappers that poll child documents must propagate the policy to their children.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".