[−][src]Struct typout::Typout
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]
D: Into<String>,
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]
D: Into<String>,
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]
I: Into<String>,
D: Into<String>,
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]
I: Into<String>,
D: Into<String>,
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]
I: Into<String>,
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,