pub struct PrintOptions {Show 13 fields
pub sep: String,
pub end: String,
pub style: Option<Style>,
pub justify: Option<JustifyMethod>,
pub overflow: Option<OverflowMethod>,
pub no_wrap: Option<bool>,
pub no_newline: bool,
pub markup: Option<bool>,
pub highlight: Option<bool>,
pub highlighter: Option<Arc<dyn Highlighter>>,
pub width: Option<usize>,
pub crop: bool,
pub soft_wrap: bool,
}Expand description
Print options for controlling output.
Fields§
§sep: StringString to separate multiple objects.
end: StringString to append at end.
style: Option<Style>Apply style to output.
justify: Option<JustifyMethod>Override justification.
overflow: Option<OverflowMethod>Override overflow handling.
no_wrap: Option<bool>Override no_wrap.
no_newline: boolSuppress newline.
markup: Option<bool>Parse markup.
highlight: Option<bool>Enable/disable highlighting (None = inherit Console setting).
highlighter: Option<Arc<dyn Highlighter>>Override the highlighter used when highlighting is enabled.
width: Option<usize>Override width.
crop: boolCrop output to width.
soft_wrap: boolSoft wrap at width.
Implementations§
Source§impl PrintOptions
impl PrintOptions
Sourcepub fn with_markup(self, markup: bool) -> Self
pub fn with_markup(self, markup: bool) -> Self
Set markup parsing.
Sourcepub fn with_style(self, style: Style) -> Self
pub fn with_style(self, style: Style) -> Self
Set style.
Sourcepub fn with_end(self, end: impl Into<String>) -> Self
pub fn with_end(self, end: impl Into<String>) -> Self
Set the end string appended after output.
Sourcepub fn with_justify(self, justify: JustifyMethod) -> Self
pub fn with_justify(self, justify: JustifyMethod) -> Self
Override justification.
Sourcepub fn with_overflow(self, overflow: OverflowMethod) -> Self
pub fn with_overflow(self, overflow: OverflowMethod) -> Self
Override overflow handling.
Sourcepub fn with_no_wrap(self, no_wrap: bool) -> Self
pub fn with_no_wrap(self, no_wrap: bool) -> Self
Override no_wrap.
Sourcepub fn with_no_newline(self, no_newline: bool) -> Self
pub fn with_no_newline(self, no_newline: bool) -> Self
Suppress newline at end.
Sourcepub fn with_highlight(self, highlight: bool) -> Self
pub fn with_highlight(self, highlight: bool) -> Self
Enable/disable highlighting.
Sourcepub fn with_highlighter<H: Highlighter + 'static>(self, highlighter: H) -> Self
pub fn with_highlighter<H: Highlighter + 'static>(self, highlighter: H) -> Self
Override the highlighter for this print call.
Sourcepub fn with_width(self, width: usize) -> Self
pub fn with_width(self, width: usize) -> Self
Override width.
Sourcepub fn with_soft_wrap(self, soft_wrap: bool) -> Self
pub fn with_soft_wrap(self, soft_wrap: bool) -> Self
Soft wrap at width.
Trait Implementations§
Source§impl Clone for PrintOptions
impl Clone for PrintOptions
Source§fn clone(&self) -> PrintOptions
fn clone(&self) -> PrintOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PrintOptions
impl Debug for PrintOptions
Source§impl Default for PrintOptions
impl Default for PrintOptions
Source§fn default() -> PrintOptions
fn default() -> PrintOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for PrintOptions
impl !UnwindSafe for PrintOptions
impl Freeze for PrintOptions
impl Send for PrintOptions
impl Sync for PrintOptions
impl Unpin for PrintOptions
impl UnsafeUnpin for PrintOptions
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