[−][src]Struct grep_searcher::sinks::Bytes
A sink that provides line numbers and matches as raw bytes while ignoring everything else.
This implementation will return an error on the first match if the searcher was not configured to count lines.
The closure accepts two parameters: a line number and a raw byte string
containing the matched data. The closure returns a Result<bool, io::Error>
. If the bool
is false
, then the search stops
immediately. Otherwise, searching continues.
If multi line mode was enabled, the line number refers to the line number of the first line in the match.
Trait Implementations
impl<F: Clone> Clone for Bytes<F> where
F: FnMut(u64, &[u8]) -> Result<bool, Error>,
[src]
F: FnMut(u64, &[u8]) -> Result<bool, Error>,
impl<F: Debug> Debug for Bytes<F> where
F: FnMut(u64, &[u8]) -> Result<bool, Error>,
[src]
F: FnMut(u64, &[u8]) -> Result<bool, Error>,
impl<F> Sink for Bytes<F> where
F: FnMut(u64, &[u8]) -> Result<bool, Error>,
[src]
F: FnMut(u64, &[u8]) -> Result<bool, Error>,
type Error = Error
The type of an error that should be reported by a searcher. Read more
fn matched(
&mut self,
_searcher: &Searcher,
mat: &SinkMatch
) -> Result<bool, Error>
[src]
&mut self,
_searcher: &Searcher,
mat: &SinkMatch
) -> Result<bool, Error>
fn context(
&mut self,
_searcher: &Searcher,
_context: &SinkContext
) -> Result<bool, Self::Error>
[src]
&mut self,
_searcher: &Searcher,
_context: &SinkContext
) -> Result<bool, Self::Error>
fn context_break(&mut self, _searcher: &Searcher) -> Result<bool, Self::Error>
[src]
fn binary_data(
&mut self,
_searcher: &Searcher,
_binary_byte_offset: u64
) -> Result<bool, Self::Error>
[src]
&mut self,
_searcher: &Searcher,
_binary_byte_offset: u64
) -> Result<bool, Self::Error>
fn begin(&mut self, _searcher: &Searcher) -> Result<bool, Self::Error>
[src]
fn finish(
&mut self,
_searcher: &Searcher,
_: &SinkFinish
) -> Result<(), Self::Error>
[src]
&mut self,
_searcher: &Searcher,
_: &SinkFinish
) -> Result<(), Self::Error>
Auto Trait Implementations
impl<F> RefUnwindSafe for Bytes<F> where
F: RefUnwindSafe,
F: RefUnwindSafe,
impl<F> Send for Bytes<F> where
F: Send,
F: Send,
impl<F> Sync for Bytes<F> where
F: Sync,
F: Sync,
impl<F> Unpin for Bytes<F> where
F: Unpin,
F: Unpin,
impl<F> UnwindSafe for Bytes<F> where
F: UnwindSafe,
F: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,