[][src]Struct grep_cli::DecompressionReaderBuilder

pub struct DecompressionReaderBuilder { /* fields omitted */ }

Configures and builds a streaming reader for decompressing data.

Methods

impl DecompressionReaderBuilder[src]

pub fn new() -> DecompressionReaderBuilder[src]

Create a new builder with the default configuration.

pub fn build<P: AsRef<Path>>(
    &self,
    path: P
) -> Result<DecompressionReader, CommandError>
[src]

Build a new streaming reader for decompressing data.

If decompression is done out-of-process and if there was a problem spawning the process, then its error is logged at the debug level and a passthru reader is returned that does no decompression. This behavior typically occurs when the given file path matches a decompression command, but is executing in an environment where the decompression command is not available.

If the given file path could not be matched with a decompression strategy, then a passthru reader is returned that does no decompression.

pub fn matcher(
    &mut self,
    matcher: DecompressionMatcher
) -> &mut DecompressionReaderBuilder
[src]

Set the matcher to use to look up the decompression command for each file path.

A set of sensible rules is enabled by default. Setting this will completely replace the current rules.

pub fn get_matcher(&self) -> &DecompressionMatcher[src]

Get the underlying matcher currently used by this builder.

pub fn async_stderr(&mut self, yes: bool) -> &mut DecompressionReaderBuilder[src]

When enabled, the reader will asynchronously read the contents of the command's stderr output. When disabled, stderr is only read after the stdout stream has been exhausted (or if the process quits with an error code).

Note that when enabled, this may require launching an additional thread in order to read stderr. This is done so that the process being executed is never blocked from writing to stdout or stderr. If this is disabled, then it is possible for the process to fill up the stderr buffer and deadlock.

This is enabled by default.

Trait Implementations

impl Clone for DecompressionReaderBuilder[src]

default fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Default for DecompressionReaderBuilder[src]

impl Debug for DecompressionReaderBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.