Skip to main content

KittyImage

Trait KittyImage 

Source
pub trait KittyImage {
    // Required methods
    fn register(&self) -> Result<usize>;
    fn release(&self) -> Result<()>;
    fn show<PositionT, SizeT>(
        &self,
        position: PositionT,
        size: Option<SizeT>,
        window: Option<Rect>,
    ) -> Result<()>
       where PositionT: Into<Vec2>,
             SizeT: Into<Vec2>;
    fn hide(&self) -> Result<()>;
}
Expand description

Kitty image.

Required Methods§

Source

fn register(&self) -> Result<usize>

Register with terminal (if not already registered).

Returns the ID.

Source

fn release(&self) -> Result<()>

Release from terminal (if registered).

Source

fn show<PositionT, SizeT>( &self, position: PositionT, size: Option<SizeT>, window: Option<Rect>, ) -> Result<()>
where PositionT: Into<Vec2>, SizeT: Into<Vec2>,

Add a placement. Will also remove the existing placement (if there is one).

Position and size are in cell coordinates. If size is set will stretch the image to fit.

If window is set will display only that part of the image. The window dimensions are in pixels.

Source

fn hide(&self) -> Result<()>

Remove placement (if there is one).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§