Skip to main content

Document

Trait Document 

Source
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 id(&self) -> usize { ... }
}
Expand description

Abstraction over wrappers around BaseDocument to allow for them all to be driven by blitz-shell

Required Methods§

Source

fn inner(&self) -> DocGuard<'_>

Source

fn inner_mut(&mut self) -> DocGuardMut<'_>

Provided Methods§

Source

fn handle_ui_event(&mut self, event: UiEvent)

Update the Document in response to a UiEvent (click, keypress, etc)

Source

fn poll(&mut self, task_context: Option<Context<'_>>) -> bool

Poll any pending async operations, and flush changes to the underlying BaseDocument

Source

fn id(&self) -> usize

Get the Document’s id

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Document for Rc<RefCell<BaseDocument>>

Source§

fn inner(&self) -> DocGuard<'_>

Source§

fn inner_mut(&mut self) -> DocGuardMut<'_>

Implementors§