Struct bat::config::Config

source ·
pub struct Config<'a> {
Show 18 fields pub language: Option<&'a str>, pub show_nonprintable: bool, pub nonprintable_notation: NonprintableNotation, pub term_width: usize, pub tab_width: usize, pub loop_through: bool, pub colored_output: bool, pub true_color: bool, pub style_components: StyleComponents, pub wrapping_mode: WrappingMode, pub paging_mode: PagingMode, pub visible_lines: VisibleLines, pub theme: String, pub syntax_mapping: SyntaxMapping<'a>, pub pager: Option<&'a str>, pub use_italic_text: bool, pub highlighted_lines: HighlightedLineRanges, pub use_custom_assets: bool,
}

Fields§

§language: Option<&'a str>

The explicitly configured language, if any

§show_nonprintable: bool

Whether or not to show/replace non-printable characters like space, tab and newline.

§nonprintable_notation: NonprintableNotation

The configured notation for non-printable characters

§term_width: usize

The character width of the terminal

§tab_width: usize

The width of tab characters. Currently, a value of 0 will cause tabs to be passed through without expanding them.

§loop_through: bool

Whether or not to simply loop through all input (cat mode)

§colored_output: bool

Whether or not the output should be colorized

§true_color: bool

Whether or not the output terminal supports true color

§style_components: StyleComponents

Style elements (grid, line numbers, …)

§wrapping_mode: WrappingMode

If and how text should be wrapped

§paging_mode: PagingMode

Pager or STDOUT

§visible_lines: VisibleLines

Specifies which lines should be printed

§theme: String

The syntax highlighting theme

§syntax_mapping: SyntaxMapping<'a>

File extension/name mappings

§pager: Option<&'a str>

Command to start the pager

§use_italic_text: bool

Whether or not to use ANSI italics

§highlighted_lines: HighlightedLineRanges

Ranges of lines which should be highlighted with a special background color

§use_custom_assets: bool

Whether or not to allow custom assets. If this is false or if custom assets (a.k.a. cached assets) are not available, assets from the binary will be used instead.

Trait Implementations§

source§

impl<'a> Clone for Config<'a>

source§

fn clone(&self) -> Config<'a>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a> Debug for Config<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> Default for Config<'a>

source§

fn default() -> Config<'a>

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

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for Config<'a>

§

impl<'a> Send for Config<'a>

§

impl<'a> Sync for Config<'a>

§

impl<'a> Unpin for Config<'a>

§

impl<'a> UnwindSafe for Config<'a>

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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.