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(&self) -> Box<dyn Formatter + '_>
pub fn stdout_formatter(&self) -> Box<dyn Formatter + '_>
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(&self) -> Box<dyn Formatter + '_>
pub fn stderr_formatter(&self) -> Box<dyn Formatter + '_>
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 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>
sourcepub fn finalize_pager(&mut self)
pub fn finalize_pager(&mut self)
Waits for the pager exits.
pub fn can_prompt() -> bool
pub fn prompt(&mut self, prompt: &str) -> Result<String>
sourcepub fn prompt_choice(
&mut self,
prompt: &str,
choices: &[impl AsRef<str>],
default: Option<&str>
) -> Result<String>
pub fn prompt_choice( &mut self, prompt: &str, choices: &[impl AsRef<str>], default: Option<&str> ) -> Result<String>
Repeat the given prompt until the input is one of the specified choices.
sourcepub fn prompt_yes_no(
&mut self,
prompt: &str,
default: Option<bool>
) -> Result<bool>
pub fn prompt_yes_no( &mut self, prompt: &str, default: Option<bool> ) -> Result<bool>
Prompts for a yes-or-no response, with yes = true and no = false.
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