pub struct StreamWithState<'f, A = AlwaysMatch>where
A: Automaton,{
fst: FstRef<'f>,
aut: A,
inp: Vec<u8>,
empty_output: Option<Output>,
stack: Vec<StreamState<'f, A::State>>,
end_at: Bound,
}
Expand description
A lexicographically ordered stream of key-value-state triples from an fst and an automaton.
The key-values are from the underyling FSTP while the states are from the automaton.
The A
type parameter corresponds to an optional automaton to filter
the stream. By default, no filtering is done.
The 'm
lifetime parameter refers to the lifetime of the underlying map.
Fields§
§fst: FstRef<'f>
§aut: A
§inp: Vec<u8>
§empty_output: Option<Output>
§stack: Vec<StreamState<'f, A::State>>
§end_at: Bound
Implementations§
Source§impl<'f, A: Automaton> StreamWithState<'f, A>
impl<'f, A: Automaton> StreamWithState<'f, A>
fn new( fst: FstRef<'f>, aut: A, min: Bound, max: Bound, ) -> StreamWithState<'f, A>
Sourcefn seek_min(&mut self, min: Bound)
fn seek_min(&mut self, min: Bound)
Seeks the underlying stream such that the next key to be read is the smallest key in the underlying fst that satisfies the given minimum bound.
This theoretically should be straight-forward, but we need to make sure our stack is correct, which includes accounting for automaton states.
fn next_with<T>( &mut self, map: impl FnMut(&A::State) -> T, ) -> Option<(&[u8], Output, T)>
Trait Implementations§
Source§impl<'a, 'f, A: 'a + Automaton> Streamer<'a> for StreamWithState<'f, A>
impl<'a, 'f, A: 'a + Automaton> Streamer<'a> for StreamWithState<'f, A>
Auto Trait Implementations§
impl<'f, A> Freeze for StreamWithState<'f, A>where
A: Freeze,
impl<'f, A> RefUnwindSafe for StreamWithState<'f, A>
impl<'f, A> Send for StreamWithState<'f, A>
impl<'f, A> Sync for StreamWithState<'f, A>
impl<'f, A> Unpin for StreamWithState<'f, A>
impl<'f, A> UnwindSafe for StreamWithState<'f, A>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more