Writer

Struct Writer 

Source
pub struct Writer { /* private fields */ }

Implementations§

Source§

impl Writer

Source

pub fn write_raw(&mut self, data: &[u8])

Source

pub fn write(&mut self, data: &[u8])

Source

pub fn write_raw_str(&mut self, data: &str)

Source

pub fn write_str(&mut self, data: &str)

Examples found in repository?
examples/basic.rs (line 27)
26    fn execute(&mut self, command: &str, writer: &mut Writer) -> CommandState {
27        writer.write_str(&format!("Command: {}", command));
28        writer.write_str("\n");
29        CommandState::Ok
30    }
Source

pub fn write_colored_string(&mut self, data: &ColoredString)

Source

pub fn write_colored_chars(&mut self, data: &[ColoredChar])

Source

pub fn write_colored_str(&mut self, data: &ColoredStr<'_>)

Source§

impl Writer

Source

pub fn erase_display(&mut self)

Source

pub fn erase_up(&mut self)

Source

pub fn erase_down(&mut self)

Source

pub fn erase_start_of_line(&mut self)

Source

pub fn erase_end_of_line(&mut self)

Source

pub fn erase_line(&mut self)

Source§

impl Writer

Source

pub fn show_cursor(&mut self)

Source

pub fn hide_cursor(&mut self)

Source

pub fn cursor_go_to(&mut self, row: usize, col: usize)

Source

pub fn cursor_up(&mut self, n: isize)

Source

pub fn cursor_down(&mut self, n: isize)

Source

pub fn cursor_forward(&mut self, n: isize)

Source

pub fn cursor_backward(&mut self, n: isize)

Source

pub fn ask_for_cpr(&mut self)

Source

pub fn save_cursor(&mut self)

Source

pub fn pop_cursor(&mut self)

Source§

impl Writer

Source

pub fn scroll_down(&mut self)

Source

pub fn scroll_up(&mut self)

Source§

impl Writer

Source

pub fn set_title(&mut self, title: &str)

Source

pub fn clear_title(&mut self)

Source§

impl Writer

Source

pub fn set_color( &mut self, foreground_color: Color, background_color: Color, bold: bool, )

Source

pub fn set_display_attributes( &mut self, foreground_color: Color, background_color: Color, attribute: DisplayAttribute, )

Source

pub fn get_changed(&self) -> bool

Trait Implementations§

Source§

impl Default for Writer

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Drop for Writer

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl Freeze for Writer

§

impl RefUnwindSafe for Writer

§

impl Send for Writer

§

impl Sync for Writer

§

impl Unpin for Writer

§

impl UnwindSafe for Writer

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.