pub trait InferenceWriterChannel<O> {
// Required methods
fn write(&self, output: O) -> Result<(), InferenceWriterError>;
fn error(
&self,
error: Box<dyn Error + Send + Sync>,
) -> Result<(), InferenceWriterError>;
fn finish(&self, duration: Duration);
}Expand description
Trait representing an inference task that can be executed with a given input and a writer for outputs. The inference implementation is responsible for writing outputs and errors to the provided writer, which will be sent back to the session.
Required Methods§
Sourcefn write(&self, output: O) -> Result<(), InferenceWriterError>
fn write(&self, output: O) -> Result<(), InferenceWriterError>
Write an output item to the channel. This can be called multiple times to emit multiple items.