1
0
mirror of https://github.com/BurntSushi/ripgrep.git synced 2024-12-12 19:18:24 +02:00
ripgrep/grep-searcher
Andrew Gallant 3dd4b77dfb
grep-searcher: add Box<...> impl for Sink
We initially did not have this impl because the first revision of the Sink
trait was much more complicated. In particular, each method was
parameterized over a Matcher. But not every Sink impl actually needs a
Matcher, and it is just as easy to borrow a Matcher explicitly, so the
added parameterization wasn't holding its own.

This does permit Sink implementations to be used as trait objects. One
key use case here is to reduce compile times, since there is quite a bit
of code inside grep-searcher that is parameterized on Sink. Unfortunately,
that code is *also* parameterized on Matcher, and the various printers in
grep-printer are also parameterized on Matcher, which means Sink trait
objects are necessary but no sufficient for a major reduction in compile
times. Unfortunately, the path to making Matcher object safe isn't quite
clear. Extension traits maybe? There's also stuff in the Serde ecosystem
that might help, but the type shenanigans can get pretty gnarly.
2018-09-07 12:06:05 -04:00
..
examples libripgrep: initial commit introducing libripgrep 2018-08-20 07:10:19 -04:00
src grep-searcher: add Box<...> impl for Sink 2018-09-07 12:06:05 -04:00
Cargo.toml deps: update libripgrep crate versions 2018-08-20 17:34:45 -04:00
LICENSE-MIT libripgrep: initial commit introducing libripgrep 2018-08-20 07:10:19 -04:00
README.md libripgrep: initial commit introducing libripgrep 2018-08-20 07:10:19 -04:00
UNLICENSE libripgrep: initial commit introducing libripgrep 2018-08-20 07:10:19 -04:00

grep-searcher

A high level library for executing fast line oriented searches. This handles things like reporting contextual lines, counting lines, inverting a search, detecting binary data, automatic UTF-16 transcoding and deciding whether or not to use memory maps.

Linux build status Windows build status

Dual-licensed under MIT or the UNLICENSE.

Documentation

https://docs.rs/grep-searcher

NOTE: You probably don't want to use this crate directly. Instead, you should prefer the facade defined in the grep crate.

Usage

Add this to your Cargo.toml:

[dependencies]
grep-searcher = "0.1"

and this to your crate root:

extern crate grep_searcher;