Struct Dummy

Source
pub struct Dummy;
Expand description

Dummy backend that does nothing and immediately exits.

Mostly used for testing.

Implementations§

Source§

impl Dummy

Source

pub fn init() -> Box<dyn Backend>
where Dummy: Sized,

Creates a new dummy backend.

Trait Implementations§

Source§

impl Backend for Dummy

Source§

fn name(&self) -> &str

Returns a name to identify the backend. Read more
Source§

fn set_title(&mut self, _title: String)

Sets the title for the backend. Read more
Source§

fn refresh(&mut self)

Refresh the screen. Read more
Source§

fn has_colors(&self) -> bool

Should return true if this backend supports colors.
Source§

fn screen_size(&self) -> XY<usize>

Returns the screen size.
Source§

fn poll_event(&mut self) -> Option<Event>

Polls the backend for any input. Read more
Source§

fn move_to(&self, _: XY<usize>)

Move the cursor to the given cell. Read more
Source§

fn print(&self, _: &str)

Print some text at the current cursor. Read more
Source§

fn clear(&self, _: Color)

Clears the screen with the given color.
Source§

fn set_color(&self, colors: ColorPair) -> ColorPair

Starts using a new color. Read more
Source§

fn set_effect(&self, _: Effect)

Enables the given effect. Read more
Source§

fn unset_effect(&self, _: Effect)

Disables the given effect.
Source§

fn is_persistent(&self) -> bool

Returns true if the backend has persistent output. Read more

Auto Trait Implementations§

§

impl Freeze for Dummy

§

impl RefUnwindSafe for Dummy

§

impl Send for Dummy

§

impl Sync for Dummy

§

impl Unpin for Dummy

§

impl UnwindSafe for Dummy

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> 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, 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> With for T

Source§

fn wrap_with<U, F>(self, f: F) -> U
where F: FnOnce(Self) -> U,

Calls the given closure and return the result. Read more
Source§

fn with<F>(self, f: F) -> Self
where F: FnOnce(&mut Self),

Calls the given closure on self.
Source§

fn try_with<E, F>(self, f: F) -> Result<Self, E>
where F: FnOnce(&mut Self) -> Result<(), E>,

Calls the given closure on self.
Source§

fn with_if<F>(self, condition: bool, f: F) -> Self
where F: FnOnce(&mut Self),

Calls the given closure if condition == true.