pub struct Ui { /* private fields */ }Implementations§
Source§impl Ui
impl Ui
pub fn new() -> Self
pub fn with_config(config: Config) -> Self
Sourcepub fn cached_with_config(config: Config, envelope_mode: EnvelopeMode) -> Self
pub fn cached_with_config(config: Config, envelope_mode: EnvelopeMode) -> Self
Returns a cached Ui instance configured with the given config and envelope mode. The cache is per-thread and keyed by config. If the same config is requested, the cached instance is returned, avoiding repeated creation.
pub fn use_color(&self) -> bool
Sourcepub fn envelope(&self) -> &EnvelopeConfig
pub fn envelope(&self) -> &EnvelopeConfig
Get reference to the current envelope configuration.
pub fn with_envelope(self, config: EnvelopeConfig) -> Self
pub fn with_envelope_mode(self, mode: EnvelopeMode) -> Self
pub fn with_envelope_layout(self, layout: EnvelopeLayout) -> Self
pub fn with_envelope_fields(self, fields: EnvelopeFields) -> Self
pub fn with_prompt_theme(self, theme: PromptTheme) -> Self
pub fn prompt_theme(&self) -> &PromptTheme
pub fn with_format(self, format: Format) -> Self
pub fn interactive(self, value: bool) -> Self
pub fn auto_yes(self, value: bool) -> Self
pub fn logger(&self) -> Logger<'_>
pub fn new_output_content(&self) -> Output
pub fn new_output_meta(&self) -> Meta
pub fn render(&self, output: &Output) -> UiResult<String>
pub fn print(&self, output: &Output) -> UiResult<()>
pub fn print_with_meta( &self, output: &Output, meta: Option<&Meta>, ok: bool, ) -> UiResult<()>
pub fn git_diff(&self, diff: &str) -> String
Trait Implementations§
Source§impl LoggerTrait for Ui
impl LoggerTrait for Ui
Source§impl PromptTrait for Ui
impl PromptTrait for Ui
fn text( &self, message: &str, default: Option<&str>, help: Option<&str>, ) -> UiResult<String>
fn confirm(&self, message: &str, default: bool) -> UiResult<bool>
fn select(&self, request: &SelectRequest) -> UiResult<String>
fn multiselect(&self, request: &MultiSelectRequest) -> UiResult<Vec<String>>
Auto Trait Implementations§
impl Freeze for Ui
impl RefUnwindSafe for Ui
impl Send for Ui
impl Sync for Ui
impl Unpin for Ui
impl UnsafeUnpin 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