[][src]Struct typout::Typout

pub struct Typout { /* fields omitted */ }

Typout represents a wrapper around the standard output of the current process (stdout).

Implementations

impl Typout[src]

pub fn with_spinner(spinner: Spinner) -> Self[src]

Creates a new Typout object with a configured spinner instance.

impl Typout[src]

pub fn set_spinner(&mut self, spinner: Spinner)[src]

Sets the spinner instance.

pub fn write<D>(&mut self, data: D) where
    D: Into<String>, 
[src]

Appends data to the output buffer.

pub fn drain(&self)[src]

Clears buffered output data.

pub fn flush(&self)[src]

Sends buffered output data to the standard output of the current process which displays the data in the terminal. The output buffer is cleared afterwards.

pub fn print<D>(&mut self, data: D) where
    D: Into<String>, 
[src]

Appends data to the output buffer and calls the flush() method.

pub fn pin<I, D>(&self, id: I, data: D) where
    I: Into<String>,
    D: Into<String>, 
[src]

Creates a new pinned message or updates an existing one. Pinned messages always stayed visible at the end of the output stream. An arbitrary number of pinned messages is allowed. Pins are uniquely identified by the provided id parameter.

pub fn spin<I, D>(&mut self, id: I, data: D) where
    I: Into<String>,
    D: Into<String>, 
[src]

Creates a new animated pinned message or updates an existing one. It spawns the spinner animation thread for each new id. If the spinner with the provided id already exists, then only the message is updated.

pub fn unpin<I>(&mut self, id: I) where
    I: Into<String>, 
[src]

Removes a pinned message with the provided id. This method works for all pinned messages including animated spinners.

Trait Implementations

impl Clone for Typout[src]

impl Debug for Typout[src]

impl Default for Typout[src]

When the terminal starts, the output handler is spawned in a new thread. The messages and all other intents are sent the output through a channel.

impl Drop for Typout[src]

For the application to gracefully exits, we make sure that all the messages are flushed and spawned threads exit before the object is dropped.

Auto Trait Implementations

impl !RefUnwindSafe for Typout

impl Send for Typout

impl !Sync for Typout

impl Unpin for Typout

impl !UnwindSafe for Typout

Blanket Implementations

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

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

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

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.

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.