pub struct RuntimeHookChain { /* private fields */ }Expand description
Ordered runtime hook composition.
Lifecycle, progress, telemetry, and log events are sent to every hook. Transform hooks are applied in order, with each hook receiving the payload returned by the previous hook.
Implementations§
Source§impl RuntimeHookChain
impl RuntimeHookChain
Sourcepub fn new(hooks: Vec<Arc<dyn RuntimeHooks>>) -> Self
pub fn new(hooks: Vec<Arc<dyn RuntimeHooks>>) -> Self
Creates a chain from hooks in invocation order.
Trait Implementations§
Source§impl Default for RuntimeHookChain
impl Default for RuntimeHookChain
Source§fn default() -> RuntimeHookChain
fn default() -> RuntimeHookChain
Returns the “default value” for a type. Read more
Source§impl RuntimeHooks for RuntimeHookChain
impl RuntimeHooks for RuntimeHookChain
fn env_connected<'life0, 'async_trait>(
&'life0 self,
event: EnvConnectedEvent,
) -> Pin<Box<dyn Future<Output = Result<(), HookError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn model_connected<'life0, 'async_trait>(
&'life0 self,
event: ModelConnectedEvent,
) -> Pin<Box<dyn Future<Output = Result<(), HookError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn session_started<'life0, 'async_trait>(
&'life0 self,
event: SessionStartedEvent,
) -> Pin<Box<dyn Future<Output = Result<(), HookError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn episode_started<'life0, 'async_trait>(
&'life0 self,
event: EpisodeStartedEvent,
) -> Pin<Box<dyn Future<Output = Result<(), HookError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn episode_completed<'life0, 'async_trait>(
&'life0 self,
event: EpisodeCompletedEvent,
) -> Pin<Box<dyn Future<Output = Result<(), HookError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn action_received<'life0, 'async_trait>(
&'life0 self,
event: ActionReceivedEvent,
) -> Pin<Box<dyn Future<Output = Result<(), HookError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn transform_action<'life0, 'async_trait>(
&'life0 self,
event: ActionReceivedEvent,
) -> Pin<Box<dyn Future<Output = Result<Option<MessageBytes>, HookError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn step_completed<'life0, 'async_trait>(
&'life0 self,
event: StepCompletedEvent,
) -> Pin<Box<dyn Future<Output = Result<(), HookError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn observation_emitted<'life0, 'async_trait>(
&'life0 self,
event: ObservationEmittedEvent,
) -> Pin<Box<dyn Future<Output = Result<(), HookError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn transform_observation<'life0, 'async_trait>(
&'life0 self,
event: ObservationEmittedEvent,
) -> Pin<Box<dyn Future<Output = Result<Option<MessageBytes>, HookError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn telemetry_window<'life0, 'async_trait>(
&'life0 self,
event: TelemetryWindowEvent,
) -> Pin<Box<dyn Future<Output = Result<(), HookError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn telemetry_summary<'life0, 'async_trait>(
&'life0 self,
event: TelemetrySummaryEvent,
) -> Pin<Box<dyn Future<Output = Result<(), HookError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn session_ended<'life0, 'async_trait>(
&'life0 self,
event: SessionEndedEvent,
) -> Pin<Box<dyn Future<Output = Result<(), HookError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn session_failed<'life0, 'async_trait>(
&'life0 self,
event: SessionFailedEvent,
) -> Pin<Box<dyn Future<Output = Result<(), HookError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn log<'life0, 'async_trait>(
&'life0 self,
event: LogEvent,
) -> Pin<Box<dyn Future<Output = Result<(), HookError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl !RefUnwindSafe for RuntimeHookChain
impl !UnwindSafe for RuntimeHookChain
impl Freeze for RuntimeHookChain
impl Send for RuntimeHookChain
impl Sync for RuntimeHookChain
impl Unpin for RuntimeHookChain
impl UnsafeUnpin for RuntimeHookChain
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
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request