Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose StreamState #1

Merged
merged 15 commits into from
Aug 8, 2019
Merged

Expose StreamState #1

merged 15 commits into from
Aug 8, 2019

Conversation

hntd187
Copy link

@hntd187 hntd187 commented Aug 2, 2019

PR From BurntSushi#61 retrofitted here.

fulmicoton and others added 14 commits November 5, 2018 07:23
The feature is there by default and just enables the `mmap` feature
in the fst crate when enabled.

Closes BurntSushi#70
The lazy_static 1.2 release increases the minimum Rust version, so we do
the same.
Just fixing mardown.

(The image didn't show on docs.rs, because of the newline.)
Reading the docs previously was a bit confusing ‒ while the nature of
the operation hints at exactly one IndexValue, the interface hints at
arbitrary number and the docs kind of did too and one has to wonder what
the trick is. Pointing it out explicitly should prevent the latter.

PR BurntSushi#76
It's like to_vec, but without making copies.

The reason why it didn't already exist is because the &[u8] tends to be a
memory map, or at the very least, could be a memory map. In that circumstance,
getting access to the raw slice without needing to type unsafe would be bad.
With that said, since the last release, constructing an FST from a memory map
now requires typing unsafe. There is even a safe method called as_bytes on the
MmapReadOnly type. So to that end, the absence of this method was likely an
oversight, and should now be an okay addition.

PR BurntSushi#77
These are useful for constructing sets/maps directly from
raw bytes.

PR BurntSushi#80
This adds ability to match exact strings against the given set, as well
as enables trie usecase by combining it with `StartsWith<_>`.

We could have implemented `Automaton` for `&[u8]`/`&str` directly,
but this path is a bit more conservative for now.

PR BurntSushi#79
src/lib.rs Outdated
@@ -13,7 +15,7 @@ pub use error::{Error, Result};
pub use map::{Map, MapBuilder};
pub use stream::{IntoStreamer, Streamer};

mod regex;
pub mod regex;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you added that to fix a doctest. This is not needed. The problem is fixed in master

src/map.rs Outdated
type Item = (&'a [u8], u64, A::State);

fn next(&'a mut self) -> Option<Self::Item> {
/// My IDE Does not like this, and if I pub this function the compile fails, I'm a bit confused
Copy link

@fulmicoton fulmicoton Aug 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this comment.

what did you mean by "pub" this function?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if I write pub fn next(...) instead of just fn next(...) the code does not compile

@fulmicoton fulmicoton merged commit b4da669 into quickwit-inc:master Aug 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants