Skip to main content

Strat9RatatuiBackend

Struct Strat9RatatuiBackend 

Source
pub struct Strat9RatatuiBackend {
    cursor: Position,
    cursor_visible: bool,
}

Fields§

§cursor: Position§cursor_visible: bool

Implementations§

Source§

impl Strat9RatatuiBackend

Source

pub fn new() -> Result<Self, BackendError>

Creates a new instance.

Source

fn map_fg_color(color: Color) -> RgbColor

Maps fg color.

Source

fn map_bg_color(color: Color) -> RgbColor

Maps bg color.

Source

fn normalize_symbol(symbol: &str) -> char

Performs the normalize symbol operation.

Source

fn draw_cell(&self, x: u16, y: u16, cell: &Cell)

Performs the draw cell operation.

Trait Implementations§

Source§

impl Backend for Strat9RatatuiBackend

Source§

fn draw<'a, I>(&mut self, content: I) -> Result<(), Self::Error>
where I: Iterator<Item = (u16, u16, &'a Cell)>,

Performs the draw operation.

Source§

fn hide_cursor(&mut self) -> Result<(), Self::Error>

Performs the hide cursor operation.

Source§

fn show_cursor(&mut self) -> Result<(), Self::Error>

Performs the show cursor operation.

Source§

fn get_cursor_position(&mut self) -> Result<Position, Self::Error>

Returns cursor position.

Source§

fn set_cursor_position<P: Into<Position>>( &mut self, position: P, ) -> Result<(), Self::Error>

Sets cursor position.

Source§

fn clear(&mut self) -> Result<(), Self::Error>

Performs the clear operation.

Source§

fn clear_region(&mut self, clear_type: ClearType) -> Result<(), Self::Error>

Performs the clear region operation.

Source§

fn size(&self) -> Result<Size, Self::Error>

Performs the size operation.

Source§

fn window_size(&mut self) -> Result<WindowSize, Self::Error>

Performs the window size operation.

Source§

fn flush(&mut self) -> Result<(), Self::Error>

Performs the flush operation.

Source§

type Error = BackendError

Error type associated with this Backend.
§

fn append_lines(&mut self, _n: u16) -> Result<(), Self::Error>

Insert n line breaks to the terminal screen. Read more
§

fn get_cursor(&mut self) -> Result<(u16, u16), Self::Error>

👎Deprecated:

use get_cursor_position() instead which returns Result<Position>

Get the current cursor position on the terminal screen. Read more
§

fn set_cursor(&mut self, x: u16, y: u16) -> Result<(), Self::Error>

👎Deprecated:

use set_cursor_position((x, y)) instead which takes impl Into<Position>

Set the cursor position on the terminal screen to the given x and y coordinates. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.