Struct grep_cli::DecompressionReaderBuilder [−][src]
pub struct DecompressionReaderBuilder { /* fields omitted */ }Configures and builds a streaming reader for decompressing data.
Methods
impl DecompressionReaderBuilder[src]
impl DecompressionReaderBuilderpub fn new() -> DecompressionReaderBuilder[src]
pub fn new() -> DecompressionReaderBuilderCreate a new builder with the default configuration.
pub fn build<P: AsRef<Path>>(
&self,
path: P
) -> Result<DecompressionReader, CommandError>[src]
pub fn build<P: AsRef<Path>>(
&self,
path: P
) -> Result<DecompressionReader, CommandError>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]
pub fn matcher(
&mut self,
matcher: DecompressionMatcher
) -> &mut DecompressionReaderBuilderSet 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]
pub fn get_matcher(&self) -> &DecompressionMatcherGet the underlying matcher currently used by this builder.
pub fn async_stderr(&mut self, yes: bool) -> &mut DecompressionReaderBuilder[src]
pub fn async_stderr(&mut self, yes: bool) -> &mut DecompressionReaderBuilderWhen 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]
impl Clone for DecompressionReaderBuilderfn clone(&self) -> DecompressionReaderBuilder[src]
fn clone(&self) -> DecompressionReaderBuilderReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl Debug for DecompressionReaderBuilder[src]
impl Debug for DecompressionReaderBuilderfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Default for DecompressionReaderBuilder[src]
impl Default for DecompressionReaderBuilderfn default() -> DecompressionReaderBuilder[src]
fn default() -> DecompressionReaderBuilderReturns the "default value" for a type. Read more
Auto Trait Implementations
impl Send for DecompressionReaderBuilder
impl Send for DecompressionReaderBuilderimpl Sync for DecompressionReaderBuilder
impl Sync for DecompressionReaderBuilder