Comments (7)
The Read trait supports that.
I will not be adding async support without a very compelling and detailed justification for it. If you can provide that, we can reopen this issue.
from aho-corasick.
If I wanted to do something like:
let in: &[u8] = ...;
let out: &[u8] = replacer.feed(in);
How can this be done with the current interface?
Note that replacer
was pre-existing, so might be in a non-initial state (not trying to feed all of the input at once).
from aho-corasick.
You haven't described your problem in enough detail for me to be able to answer you.
async seems like a red herring.
It sounds like you want a push API, but this crate only exposes a pull API. If you want a push API you'll probably need to build it yourself using regex-automata.
from aho-corasick.
I’m fine with push or pull, just don’t want to have a thread/stack allocated for each long-running replacer.
Use-case is streaming log filtering.
from aho-corasick.
Like I said, I don't see this happening without a very detailed investigation. This crate is primarily about text search, which is a CPU bound operation. There's only a tiny little sliver of API that has anything to do with I/O, and that's a convenience function for searching std::io::Read because it's a low hanging fruit.
from aho-corasick.
I would rather work to expose APIs that permit callers to implement any necessary I/O glue instead of providing it in this crate.
from aho-corasick.
I’m not asking for Tokio/futures Streams/… support, to be clear. Fine with any API that allows me to write the glue.
Maybe this API aready exists, I just don’t have the imagination how to make it work short of allocating a dedicated thread. Pull is fine, but then needs O_NONBLOCK :)
Rephrased differently, I’d like to get the internal state somewhere else than on the stack if possible, so I can resume later.
Thanks for the pointer to regex-automata!
from aho-corasick.
Related Issues (20)
- For Python wrapper, is it worth switching to new NFA, or sticking to DFA? HOT 2
- [Note] Investigating "transmute slower than intrinsics for vector unpacking" HOT 1
- Serializing pre-built automaton HOT 7
- RFC: review API before 1.0 release HOT 15
- Benchmarks results aren't clear HOT 11
- Default `anchored` value in a new `Input`. HOT 2
- AhoCorasick::memory_usage doctests fail on i686 (and possibly most 32-bit architectures) HOT 3
- nfa::contiguous::tests::swar test failure on s390x (and possibly all big-endian architectures) HOT 3
- Question: Suggestions for handling . wildcards within query patterns HOT 1
- Go wrapper for aho-corasick HOT 10
- A performance issue vs pyahocorasick HOT 3
- Potential performance improvement, maybe HOT 3
- panic at invalid char boundary HOT 3
- heap_bytes is inaccurate HOT 5
- Motion to grant V1.0.0 status HOT 9
- confused auto_configure HOT 2
- big simplification to the leftmost match NFA construction HOT 2
- Make len() available on `Match` HOT 1
- question: comparisson with a regex union. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aho-corasick.