pub struct Reader { /* private fields */ }Expand description
ARGF-style multi-source streaming reader.
Reads from stdin, one or more files, or a child process’s stdout.
Uses raw read() calls (not line-buffered) to enable true streaming.
Implementations§
Source§impl Reader
impl Reader
pub fn new(sources: Vec<Source>, forced_format: Option<Format>) -> Self
Sourcepub fn from_args(args: &[String], command_mode: bool) -> Self
pub fn from_args(args: &[String], command_mode: bool) -> Self
Convenience: build sources from CLI args (empty args → stdin).
In command mode (-c) treat args as a shell command.
Sourcepub fn format(&self) -> Option<Format>
pub fn format(&self) -> Option<Format>
The detected (or forced) input format. Only valid after at least one
call to Reader::read_chunks or [Reader::sniff].
Auto Trait Implementations§
impl Freeze for Reader
impl RefUnwindSafe for Reader
impl Send for Reader
impl Sync for Reader
impl Unpin for Reader
impl UnsafeUnpin for Reader
impl UnwindSafe for Reader
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