pub struct FirstOccurrenceFilter<S>where
S: ScopeData,{ /* private fields */ }Expand description
Streaming first-occurrence middleware.
Repeated annotations inside a context have first_in_context cleared and
presentation requirements removed once the context is flushed.
Implementations§
Source§impl<S> FirstOccurrenceFilter<S>where
S: ScopeData,
impl<S> FirstOccurrenceFilter<S>where
S: ScopeData,
Sourcepub fn new(window: ContextWindow) -> FirstOccurrenceFilter<S>
pub fn new(window: ContextWindow) -> FirstOccurrenceFilter<S>
Creates a first-occurrence filter for the selected context window.
Sourcepub fn push_token(&mut self, token: OutputToken<S>) -> Vec<OutputToken<S>>
pub fn push_token(&mut self, token: OutputToken<S>) -> Vec<OutputToken<S>>
Pushes one output token and returns tokens ready for downstream stages.
Sourcepub fn finish(self) -> Vec<OutputToken<S>>
pub fn finish(self) -> Vec<OutputToken<S>>
Finishes the middleware and returns buffered tokens.
Auto Trait Implementations§
impl<S> Freeze for FirstOccurrenceFilter<S>
impl<S> RefUnwindSafe for FirstOccurrenceFilter<S>where
S: RefUnwindSafe,
impl<S> Send for FirstOccurrenceFilter<S>where
S: Send,
impl<S> Sync for FirstOccurrenceFilter<S>where
S: Sync,
impl<S> Unpin for FirstOccurrenceFilter<S>where
S: Unpin,
impl<S> UnsafeUnpin for FirstOccurrenceFilter<S>
impl<S> UnwindSafe for FirstOccurrenceFilter<S>where
S: UnwindSafe,
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