pub struct Ui { /* private fields */ }Implementations§
source§impl Ui
impl Ui
pub fn with_config(config: &Config) -> Result<Ui, CommandError>
pub fn reset(&mut self, config: &Config) -> Result<(), CommandError>
sourcepub fn request_pager(&mut self)
pub fn request_pager(&mut self)
Switches the output to use the pager, if allowed.
pub fn color(&self) -> bool
pub fn new_formatter<'output, W: Write + 'output>( &self, output: W ) -> Box<dyn Formatter + 'output>
sourcepub fn stdout_formatter<'a>(&'a self) -> Box<dyn Formatter + 'a>
pub fn stdout_formatter<'a>(&'a self) -> Box<dyn Formatter + 'a>
Creates a formatter for the locked stdout stream.
Labels added to the returned formatter should be removed by caller. Otherwise the last color would persist.
sourcepub fn stderr_formatter<'a>(&'a self) -> Box<dyn Formatter + 'a>
pub fn stderr_formatter<'a>(&'a self) -> Box<dyn Formatter + 'a>
Creates a formatter for the locked stderr stream.
sourcepub fn stderr_for_child(&self) -> Result<Stdio>
pub fn stderr_for_child(&self) -> Result<Stdio>
Stderr stream to be attached to a child process.
sourcepub fn use_progress_indicator(&self) -> bool
pub fn use_progress_indicator(&self) -> bool
Whether continuous feedback should be displayed for long-running operations
pub fn progress_output(&self) -> Option<ProgressOutput>
pub fn write(&mut self, text: &str) -> Result<()>
pub fn write_stderr(&mut self, text: &str) -> Result<()>
pub fn write_fmt(&mut self, fmt: Arguments<'_>) -> Result<()>
pub fn hint(&self) -> LabeledWriter<Box<dyn Formatter + '_>, &'static str>
pub fn warning(&self) -> LabeledWriter<Box<dyn Formatter + '_>, &'static str>
pub fn error(&self) -> LabeledWriter<Box<dyn Formatter + '_>, &'static str>
pub fn flush(&mut self) -> Result<()>
sourcepub fn finalize_pager(&mut self)
pub fn finalize_pager(&mut self)
Waits for the pager exits.
pub fn prompt(&mut self, prompt: &str) -> Result<String>
pub fn prompt_password(&mut self, prompt: &str) -> Result<String>
pub fn term_width(&self) -> Option<u16>
Auto Trait Implementations§
impl RefUnwindSafe for Ui
impl Send for Ui
impl Sync for Ui
impl Unpin for Ui
impl UnwindSafe for Ui
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more