Skip to main content

Config

Struct Config 

Source
pub struct Config {
Show 29 fields pub list: ListOptions, pub output: OutputMode, pub color: ColorWhen, pub human_sizes: bool, pub si_sizes: bool, pub icons: bool, pub classify: bool, pub indicator: IndicatorStyle, pub terminal_width: usize, pub is_stdout_tty: bool, pub show_owner: bool, pub show_group: bool, pub numeric_uid_gid: bool, pub show_inode: bool, pub show_blocks: bool, pub full_time: bool, pub show_git: bool, pub quoting_style: QuotingStyle, pub control_chars: ControlChars, pub show_author: bool, pub block_size: BlockSize, pub kibibytes: bool, pub tabsize: usize, pub hyperlink: HyperlinkWhen, pub show_context: bool, pub zero: bool, pub dired: bool, pub time_style: TimeStyle, pub emit_block_total: bool,
}
Expand description

Full runtime configuration combining listing and presentation.

Fields§

§list: ListOptions§output: OutputMode§color: ColorWhen§human_sizes: bool§si_sizes: bool

SI units (powers of 1000) instead of 1024 (--si).

§icons: bool§classify: bool§indicator: IndicatorStyle§terminal_width: usize

Terminal width used for multi-column layout (-w); 0 means unlimited.

§is_stdout_tty: bool§show_owner: bool§show_group: bool§numeric_uid_gid: bool§show_inode: bool§show_blocks: bool§full_time: bool§show_git: bool

When true, suppress git decorations in format (also controlled by CLI).

§quoting_style: QuotingStyle

Filename quoting style.

§control_chars: ControlChars

Control-character handling for names.

§show_author: bool

Show author column in long format (--author); usually same as owner.

§block_size: BlockSize

Block size for size/-s display.

§kibibytes: bool

Force 1024-byte blocks for -s (-k / --kibibytes).

§tabsize: usize

Tab stop size (-T / --tabsize); stored for future column layout.

§hyperlink: HyperlinkWhen

OSC 8 hyperlinks for file names.

§show_context: bool

Show SELinux security context (-Z).

§zero: bool

Use NUL as line terminator (--zero).

§dired: bool

Emacs dired mode (-D / --dired).

§time_style: TimeStyle

Long-listing time style.

§emit_block_total: bool

Print GNU total N before directory content listings (-l / -s). False when listing a single non-directory operand (or -d on a dir).

Implementations§

Source§

impl Config

Source

pub fn color_enabled(&self) -> bool

Source

pub fn effective_output(&self) -> OutputMode

Resolve default output mode: multi-column on TTY, one-per-line otherwise.

Source

pub fn indicator_style(&self) -> IndicatorStyle

Source

pub fn blocks_unit(&self) -> u64

Effective block size for allocated-size display (-s).

GNU coreutils defaults to 1024-byte units for -s (and -k forces that). A bare --block-size=1 / default long-size unit of 1 byte must not be reused for -s (that produced wild totals like 4096 for a 4KiB file). POSIXLY_CORRECT selects 512-byte units.

Source

pub fn line_ending(&self) -> &'static str

Line terminator (newline or NUL).

Source

pub fn hide_control_chars(&self) -> bool

Whether control characters should be replaced with ?.

Trait Implementations§

Source§

impl Clone for Config

Source§

fn clone(&self) -> Config

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Config

Source§

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

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

impl Default for Config

Source§

fn default() -> Self

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

Auto Trait Implementations§

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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

Source§

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

Source§

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.