Trait surf_n_term::image::ImageHandler[][src]

pub trait ImageHandler: Send + Sync {
    fn name(&self) -> &str;
fn draw(&mut self, img: &Image, out: &mut dyn Write) -> Result<(), Error>;
fn erase(&mut self, pos: Position, out: &mut dyn Write) -> Result<(), Error>;
fn handle(&mut self, event: &TerminalEvent) -> Result<bool, Error>; }

Image rendering/handling interface

Required methods

fn name(&self) -> &str[src]

Name

fn draw(&mut self, img: &Image, out: &mut dyn Write) -> Result<(), Error>[src]

Draw image

Send approprite terminal escape sequence so image would be rendered.

fn erase(&mut self, pos: Position, out: &mut dyn Write) -> Result<(), Error>[src]

Erase image at specified position

This is needed when erasing characters is not actually removing image from the terminal. For example kitty needs to send separate escape sequence to actually erase image.

fn handle(&mut self, event: &TerminalEvent) -> Result<bool, Error>[src]

Handle events frome the terminal

True means event has been handled and should not be propagated to a user

Loading content...

Implementations on Foreign Types

impl<'a> ImageHandler for Box<dyn ImageHandler>[src]

fn name(&self) -> &str[src]

fn draw(&mut self, img: &Image, out: &mut dyn Write) -> Result<(), Error>[src]

fn erase(&mut self, pos: Position, out: &mut dyn Write) -> Result<(), Error>[src]

fn handle(&mut self, event: &TerminalEvent) -> Result<bool, Error>[src]

Loading content...

Implementors

impl ImageHandler for DummyImageHandler[src]

fn name(&self) -> &str[src]

fn draw(&mut self, _img: &Image, _out: &mut dyn Write) -> Result<(), Error>[src]

fn erase(&mut self, _pos: Position, _out: &mut dyn Write) -> Result<(), Error>[src]

fn handle(&mut self, _event: &TerminalEvent) -> Result<bool, Error>[src]

impl ImageHandler for ItermImageHandler[src]

fn name(&self) -> &str[src]

fn draw(&mut self, img: &Image, out: &mut dyn Write) -> Result<(), Error>[src]

fn erase(&mut self, _pos: Position, _out: &mut dyn Write) -> Result<(), Error>[src]

fn handle(&mut self, _event: &TerminalEvent) -> Result<bool, Error>[src]

impl ImageHandler for KittyImageHandler[src]

fn name(&self) -> &str[src]

fn draw(&mut self, img: &Image, out: &mut dyn Write) -> Result<(), Error>[src]

fn erase(&mut self, pos: Position, out: &mut dyn Write) -> Result<(), Error>[src]

fn handle(&mut self, event: &TerminalEvent) -> Result<bool, Error>[src]

impl ImageHandler for SixelImageHandler[src]

fn name(&self) -> &str[src]

fn draw(&mut self, img: &Image, out: &mut dyn Write) -> Result<(), Error>[src]

fn erase(&mut self, _pos: Position, _out: &mut dyn Write) -> Result<(), Error>[src]

fn handle(&mut self, _event: &TerminalEvent) -> Result<bool, Error>[src]

Loading content...