pub struct TurnRunner<S: SessionStore> { /* private fields */ }Expand description
Executes a turn against a pooled connection.
Implementations§
Source§impl<S: SessionStore + 'static> TurnRunner<S>
impl<S: SessionStore + 'static> TurnRunner<S>
Sourcepub fn new(
pool: Arc<ConnectionPool<S>>,
gate: QueryGate,
classifier: EventClassifier,
store: Arc<S>,
cfg: Option<TurnConfig>,
) -> Self
pub fn new( pool: Arc<ConnectionPool<S>>, gate: QueryGate, classifier: EventClassifier, store: Arc<S>, cfg: Option<TurnConfig>, ) -> Self
Create a runner. cfg defaults when None.
Sourcepub fn with_broadcaster(self, b: Arc<SseBroadcaster>) -> Self
pub fn with_broadcaster(self, b: Arc<SseBroadcaster>) -> Self
Attach an SSE broadcaster for delta / thinking / complete / error fan-out.
Sourcepub fn with_input_builder(
self,
f: Arc<dyn Fn(&str, &str, Option<&Value>, Option<&InputOpts>) -> Map<String, Value> + Send + Sync>,
) -> Self
pub fn with_input_builder( self, f: Arc<dyn Fn(&str, &str, Option<&Value>, Option<&InputOpts>) -> Map<String, Value> + Send + Sync>, ) -> Self
Override the loop_input payload builder.
Sourcepub fn with_on_complete(
self,
f: Arc<dyn Fn(&str, &str, &str, &str, i64) + Send + Sync>,
) -> Self
pub fn with_on_complete( self, f: Arc<dyn Fn(&str, &str, &str, &str, i64) + Send + Sync>, ) -> Self
Completion hook (app_key, loop_id, content, completion_event, elapsed_ms).
Sourcepub fn with_on_error(
self,
f: Arc<dyn Fn(&str, &str, &Error) + Send + Sync>,
) -> Self
pub fn with_on_error( self, f: Arc<dyn Fn(&str, &str, &Error) + Send + Sync>, ) -> Self
Error hook.
Sourcepub fn with_error_data(
self,
f: Arc<dyn Fn(&Error) -> Value + Send + Sync>,
) -> Self
pub fn with_error_data( self, f: Arc<dyn Fn(&Error) -> Value + Send + Sync>, ) -> Self
Formatter for SSE query_error payloads.
Auto Trait Implementations§
impl<S> !Freeze for TurnRunner<S>
impl<S> !RefUnwindSafe for TurnRunner<S>
impl<S> !UnwindSafe for TurnRunner<S>
impl<S> Send for TurnRunner<S>
impl<S> Sync for TurnRunner<S>
impl<S> Unpin for TurnRunner<S>
impl<S> UnsafeUnpin for TurnRunner<S>
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