Struct grep_cli::DecompressionMatcher
source · pub struct DecompressionMatcher { /* private fields */ }
Expand description
A matcher for determining how to decompress files.
Implementations§
source§impl DecompressionMatcher
impl DecompressionMatcher
sourcepub fn new() -> DecompressionMatcher
pub fn new() -> DecompressionMatcher
Create a new matcher with default rules.
To add more matching rules, build a matcher with
DecompressionMatcherBuilder
.
sourcepub fn command<P: AsRef<Path>>(&self, path: P) -> Option<Command>
pub fn command<P: AsRef<Path>>(&self, path: P) -> Option<Command>
Return a pre-built command based on the given file path that can
decompress its contents. If no such decompressor is known, then this
returns None
.
If there are multiple possible commands matching the given path, then the command added last takes precedence.
sourcepub fn has_command<P: AsRef<Path>>(&self, path: P) -> bool
pub fn has_command<P: AsRef<Path>>(&self, path: P) -> bool
Returns true if and only if the given file path has at least one matching command to perform decompression on.
Trait Implementations§
source§impl Clone for DecompressionMatcher
impl Clone for DecompressionMatcher
source§fn clone(&self) -> DecompressionMatcher
fn clone(&self) -> DecompressionMatcher
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for DecompressionMatcher
impl Debug for DecompressionMatcher
source§impl Default for DecompressionMatcher
impl Default for DecompressionMatcher
source§fn default() -> DecompressionMatcher
fn default() -> DecompressionMatcher
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DecompressionMatcher
impl RefUnwindSafe for DecompressionMatcher
impl Send for DecompressionMatcher
impl Sync for DecompressionMatcher
impl Unpin for DecompressionMatcher
impl UnwindSafe for DecompressionMatcher
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)