Skip to main content

CpuWindow

Struct CpuWindow 

Source
pub struct CpuWindow {
    pub state: CpuWaylandState,
    pub event_queue: EventQueue<CpuWaylandState>,
    pub buffer: TerminalBuffer,
    pub alpha: f32,
}

Fields§

§state: CpuWaylandState§event_queue: EventQueue<CpuWaylandState>§buffer: TerminalBuffer§alpha: f32

Implementations§

Source§

impl CpuWindow

Source

pub fn redraw<F>(&mut self, render_callback: F)
where F: FnMut(&mut TerminalBuffer),

Source

pub fn update(&mut self) -> Result<(), Error>

Source

pub fn get_event_queue(&self) -> WindowEventQueue

Trait Implementations§

Source§

impl Backend for CpuWindow

Source§

type Error = Error

Error type associated with this Backend.
Source§

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

Draw the given content to the terminal screen. Read more
Source§

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

Flush any buffered content to the terminal screen.
Source§

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

Get the size of the terminal screen in columns/rows as a Size. Read more
Source§

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

Clears the whole terminal screen Read more
Source§

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
Source§

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
Source§

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

Hide the cursor on the terminal screen. Read more
Source§

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

Show the cursor on the terminal screen. Read more
Source§

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

Get the size of the terminal screen in columns/rows and pixels as a WindowSize. Read more
Source§

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

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

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

Clears a specific region of the terminal specified by the ClearType parameter Read more
Source§

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

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

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

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
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
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
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.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>