pub struct WebPresenter { /* private fields */ }Expand description
WASM presenter that captures buffers and logs for the host.
Implementations§
Source§impl WebPresenter
impl WebPresenter
Sourcepub fn with_size(width: u16, height: u16) -> Self
pub fn with_size(width: u16, height: u16) -> Self
Create a new presenter with explicit initial dimensions.
Sourcepub const fn outputs(&self) -> &WebOutputs
pub const fn outputs(&self) -> &WebOutputs
Get captured outputs.
Sourcepub fn outputs_mut(&mut self) -> &mut WebOutputs
pub fn outputs_mut(&mut self) -> &mut WebOutputs
Mutably access captured outputs.
Sourcepub fn take_outputs(&mut self) -> WebOutputs
pub fn take_outputs(&mut self) -> WebOutputs
Take captured outputs, leaving empty defaults.
Sourcepub const fn pool(&self) -> &GraphemePool
pub const fn pool(&self) -> &GraphemePool
Reference to the grapheme pool.
Sourcepub fn pool_mut(&mut self) -> &mut GraphemePool
pub fn pool_mut(&mut self) -> &mut GraphemePool
Mutably access the grapheme pool.
Sourcepub const fn links(&self) -> &LinkRegistry
pub const fn links(&self) -> &LinkRegistry
Reference to the link registry.
Sourcepub fn links_mut(&mut self) -> &mut LinkRegistry
pub fn links_mut(&mut self) -> &mut LinkRegistry
Mutably access the link registry.
Sourcepub fn flatten_patches_into(&self, cells: &mut Vec<u32>, spans: &mut Vec<u32>)
pub fn flatten_patches_into(&self, cells: &mut Vec<u32>, spans: &mut Vec<u32>)
Flatten patch runs into caller-provided reusable buffers.
Clears and refills the provided cells and spans Vecs, reusing
their heap capacity across frames to avoid per-frame allocation.
Sourcepub fn present_ui_owned(
&mut self,
buf: Buffer,
diff: Option<&BufferDiff>,
full_repaint_hint: bool,
)
pub fn present_ui_owned( &mut self, buf: Buffer, diff: Option<&BufferDiff>, full_repaint_hint: bool, )
Present a frame, taking ownership of the buffer to avoid cloning.
This is the zero-copy fast path for callers that can give up ownership
(e.g. StepProgram::render_frame). The buffer is moved directly into
last_buffer instead of being cloned.
Trait Implementations§
Source§impl BackendPresenter for WebPresenter
impl BackendPresenter for WebPresenter
Source§type Error = WebBackendError
type Error = WebBackendError
Source§fn capabilities(&self) -> &TerminalCapabilities
fn capabilities(&self) -> &TerminalCapabilities
Source§fn write_log(&mut self, text: &str) -> Result<(), Self::Error>
fn write_log(&mut self, text: &str) -> Result<(), Self::Error>
Source§fn screen_mode(&self) -> ScreenMode
fn screen_mode(&self) -> ScreenMode
Source§fn set_screen_mode(&mut self, mode: ScreenMode)
fn set_screen_mode(&mut self, mode: ScreenMode)
Source§fn pool_and_links_mut(&mut self) -> (&mut GraphemePool, &mut LinkRegistry)
fn pool_and_links_mut(&mut self) -> (&mut GraphemePool, &mut LinkRegistry)
Source§fn pool_mut(&mut self) -> &mut GraphemePool
fn pool_mut(&mut self) -> &mut GraphemePool
Source§fn present_ui(
&mut self,
buf: &Buffer,
diff: Option<&BufferDiff>,
full_repaint_hint: bool,
) -> Result<(), Self::Error>
fn present_ui( &mut self, buf: &Buffer, diff: Option<&BufferDiff>, full_repaint_hint: bool, ) -> Result<(), Self::Error>
Source§fn present_ui_owned(
&mut self,
buf: Buffer,
cursor: Option<(u16, u16)>,
cursor_visible: bool,
) -> Result<(), Self::Error>
fn present_ui_owned( &mut self, buf: Buffer, cursor: Option<(u16, u16)>, cursor_visible: bool, ) -> Result<(), Self::Error>
Source§fn gc(&mut self)
fn gc(&mut self)
Source§fn set_evidence_writer(&mut self, _w: Option<Arc<dyn Fn(&str) + Send + Sync>>)
fn set_evidence_writer(&mut self, _w: Option<Arc<dyn Fn(&str) + Send + Sync>>)
Source§fn last_diff_strategy(&self) -> Option<DiffStrategy>
fn last_diff_strategy(&self) -> Option<DiffStrategy>
Source§fn last_diff_elapsed(&self) -> Option<Duration>
fn last_diff_elapsed(&self) -> Option<Duration>
Source§fn flush(&mut self) -> Result<(), Self::Error>
fn flush(&mut self) -> Result<(), Self::Error>
Source§fn suspend(&mut self) -> Result<(), Self::Error>
fn suspend(&mut self) -> Result<(), Self::Error>
resize, which
must drop any diff baseline, since the screen is no longer ours.