FancyTheme

Struct FancyTheme 

Source
pub struct FancyTheme { /* private fields */ }
Expand description

A Theme that displays with a rich UI.

Implementations§

Source§

impl FancyTheme

Source

pub fn new() -> Self

Trait Implementations§

Source§

impl Default for FancyTheme

Source§

fn default() -> Self

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

impl<W: Write> Theme<W> for FancyTheme

Source§

fn log( &mut self, term: &mut dyn Terminal<W>, message: String, ) -> Result<(), Error>

Output of messages without decoration.
Source§

fn info( &mut self, term: &mut dyn Terminal<W>, message: String, ) -> Result<(), Error>

Output of messages with info decoration.
Source§

fn warn( &mut self, term: &mut dyn Terminal<W>, message: String, ) -> Result<(), Error>

Output of messages with warning decoration.
Source§

fn error( &mut self, term: &mut dyn Terminal<W>, message: String, ) -> Result<(), Error>

Output of messages with error decoration.
Source§

fn success( &mut self, term: &mut dyn Terminal<W>, message: String, ) -> Result<(), Error>

Output of messages with success decoration.
Source§

fn step( &mut self, term: &mut dyn Terminal<W>, message: String, ) -> Result<(), Error>

Output of messages with a step decoration.
Source§

fn begin( &mut self, term: &mut dyn Terminal<W>, intro: Option<String>, ) -> Result<(), Error>

Renders the start of a prompt session.
It can render a title or message received as intro.
Source§

fn render( &mut self, term: &mut dyn Terminal<W>, payload: RenderSnapshot<'_>, ) -> Result<(), Error>

Renders the prompt.
Source§

fn finish( &mut self, term: &mut dyn Terminal<W>, state: &PromptState, outro: Option<String>, ) -> Result<(), Error>

Renders the end of a prompt session.
It can render a message received as outro.

Auto Trait Implementations§

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.