Struct add_ed::ui::DummyUI[][src]

pub struct DummyUI<'a> {
    pub input: VecDeque<String>,
    pub print_ui: Option<&'a mut dyn UI>,
}
Expand description

This is a dummy UI. That means it simulates an UI without interfacing with any users.

How to use:

  • Put the input to simulate line-by-line in the input variable.
  • If you want output from print commands put the UI to print with in print_ui.

Fields

input: VecDeque<String>print_ui: Option<&'a mut dyn UI>

Trait Implementations

impl<'a> UI for DummyUI<'a>[src]

fn get_command(&mut self, _buffer: &dyn Buffer) -> Result<String, &'static str>[src]

Get a command for parsing and execution Read more

fn get_input(
    &mut self,
    _buffer: &dyn Buffer,
    terminator: char
) -> Result<Vec<String>, &'static str>
[src]

Get input lines until given character is entered alone on a line Read more

fn print(&mut self, text: &str) -> Result<(), &'static str>[src]

A basic print for output of commands

fn print_selection(
    &mut self,
    buffer: &dyn Buffer,
    selection: (usize, usize),
    numbered: bool,
    literal: bool
) -> Result<(), &'static str>
[src]

Print the given selection with the given options Read more

Auto Trait Implementations

impl<'a> !RefUnwindSafe for DummyUI<'a>

impl<'a> !Send for DummyUI<'a>

impl<'a> !Sync for DummyUI<'a>

impl<'a> Unpin for DummyUI<'a>

impl<'a> !UnwindSafe for DummyUI<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.