pub struct PredictionStream { /* private fields */ }Expand description
An async stream that yields Predictions by combining a sample receiver
with a concurrent predictor handle.
For each Sample received from the channel,
the stream queries the shared model via the Predictor and yields
a Prediction containing both raw and transformed outputs.
The stream terminates when the underlying SampleReceiver is exhausted
(all senders dropped and channel drained).
§Implementation
Implements futures_core::Stream directly. The predictor acquires a
read lock on the shared model for each prediction, so predictions reflect
the model state at the moment of polling – not the state when the sample
was sent. This is intentional for streaming evaluation.
Implementations§
Source§impl PredictionStream
impl PredictionStream
Sourcepub fn new(receiver: SampleReceiver, predictor: Predictor) -> Self
pub fn new(receiver: SampleReceiver, predictor: Predictor) -> Self
Create a new prediction stream from a sample receiver and predictor.
The receiver provides incoming samples; the predictor queries the shared model for each one.
Trait Implementations§
Source§impl Stream for PredictionStream
impl Stream for PredictionStream
Source§type Item = Prediction
type Item = Prediction
Auto Trait Implementations§
impl Freeze for PredictionStream
impl !RefUnwindSafe for PredictionStream
impl Send for PredictionStream
impl Sync for PredictionStream
impl Unpin for PredictionStream
impl UnsafeUnpin for PredictionStream
impl !UnwindSafe for PredictionStream
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more