Skip to main content

StreamCallback

Type Alias StreamCallback 

Source
pub type StreamCallback = Box<dyn FnMut(&str) + Send>;
Expand description

Callback invoked for each generated token during streaming.

The closure runs inside the blocking worker thread, so calling tokio::sync::mpsc::Sender::blocking_send from within it is safe.

Aliased Typeยง

pub struct StreamCallback(/* private fields */);