Skip to main content

TextOutput

Struct TextOutput 

Source
pub struct TextOutput<'a> { /* private fields */ }
Expand description

Text output implementation that formats entries for terminal display.

This is the default output sink used by list for standard ls behavior. It handles all text formatting including colors, columns, long format, etc.

Implementations§

Source§

impl<'a> TextOutput<'a>

Source

pub fn new(config: &'a Config) -> Self

Trait Implementations§

Source§

impl LsOutput for TextOutput<'_>

Source§

fn write_entries( &mut self, entries: &[PathData<'_>], config: &Config, ) -> UResult<()>

Called with a batch of entries for a directory. Read more
Source§

fn write_dir_header( &mut self, path_data: &PathData<'_>, config: &Config, is_first: bool, ) -> UResult<()>

Called when entering a directory (for recursive listings or multiple arguments). Read more
Source§

fn write_total(&mut self, total_size: u64, config: &Config) -> UResult<()>

Called to report the total blocks for a directory in long format. Read more
Source§

fn flush(&mut self) -> UResult<()>

Called to flush any buffered output (e.g., before error messages).
Source§

fn finalize(&mut self, config: &Config) -> UResult<()>

Called when all entries have been written. Read more
Source§

fn initialize(&mut self, _config: &Config) -> UResult<()>

Called at the start of listing, before any entries are processed. Read more
Source§

fn stream_mode(&self) -> StreamMode

Returns the preferred output mode for this sink. Read more
Source§

fn write_entry(&mut self, _entry: &EntryInfo) -> UResult<()>

Called for each file/directory entry (streaming mode). Read more

Auto Trait Implementations§

§

impl<'a> Freeze for TextOutput<'a>

§

impl<'a> RefUnwindSafe for TextOutput<'a>

§

impl<'a> Send for TextOutput<'a>

§

impl<'a> Sync for TextOutput<'a>

§

impl<'a> Unpin for TextOutput<'a>

§

impl<'a> UnsafeUnpin for TextOutput<'a>

§

impl<'a> UnwindSafe for TextOutput<'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> ErasedDestructor for T
where T: 'static,

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