[−][src]Struct grep_searcher::sinks::UTF8
A sink that provides line numbers and matches as strings while ignoring everything else.
This implementation will return an error if a match contains invalid
UTF-8 or if the searcher was not configured to count lines. Errors
on invalid UTF-8 can be suppressed by using the Lossy
sink instead
of this one.
The closure accepts two parameters: a line number and a UTF-8 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 UTF8<F> where
F: FnMut(u64, &str) -> Result<bool, Error>,
[src]
F: FnMut(u64, &str) -> Result<bool, Error>,
impl<F: Debug> Debug for UTF8<F> where
F: FnMut(u64, &str) -> Result<bool, Error>,
[src]
F: FnMut(u64, &str) -> Result<bool, Error>,
impl<F> Sink for UTF8<F> where
F: FnMut(u64, &str) -> Result<bool, Error>,
[src]
F: FnMut(u64, &str) -> 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 UTF8<F> where
F: RefUnwindSafe,
F: RefUnwindSafe,
impl<F> Send for UTF8<F> where
F: Send,
F: Send,
impl<F> Sync for UTF8<F> where
F: Sync,
F: Sync,
impl<F> Unpin for UTF8<F> where
F: Unpin,
F: Unpin,
impl<F> UnwindSafe for UTF8<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>,