[][src]Struct grep_searcher::sinks::Bytes

pub struct Bytes<F>(pub F)
where
    F: FnMut(u64, &[u8]) -> Result<bool, Error>
;

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]

impl<F: Debug> Debug for Bytes<F> where
    F: FnMut(u64, &[u8]) -> Result<bool, Error>, 
[src]

impl<F> Sink for Bytes<F> where
    F: FnMut(u64, &[u8]) -> Result<bool, Error>, 
[src]

type Error = Error

The type of an error that should be reported by a searcher. Read more

Auto Trait Implementations

impl<F> RefUnwindSafe for Bytes<F> where
    F: RefUnwindSafe

impl<F> Send for Bytes<F> where
    F: Send

impl<F> Sync for Bytes<F> where
    F: Sync

impl<F> Unpin for Bytes<F> where
    F: Unpin

impl<F> UnwindSafe for Bytes<F> where
    F: UnwindSafe

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.