pub trait TurnLifecycleContributor: Send + Sync {
// Provided methods
fn on_turn_start<'a>(
&'a self,
input: TurnStartInput<'a>,
) -> ExtensionFuture<'a, ()> { ... }
fn on_turn_stop<'a>(
&'a self,
input: TurnStopInput<'a>,
) -> ExtensionFuture<'a, ()> { ... }
fn on_turn_abort<'a>(
&'a self,
input: TurnAbortInput<'a>,
) -> ExtensionFuture<'a, ()> { ... }
fn on_turn_error<'a>(
&'a self,
input: TurnErrorInput<'a>,
) -> ExtensionFuture<'a, ()> { ... }
}Expand description
Contributor for host-owned turn lifecycle gates.
Implementations should use these callbacks to seed, observe, or clear extension-private turn state. The host exposes stable identifiers and extension stores instead of core runtime objects.
Provided Methods§
Sourcefn on_turn_start<'a>(
&'a self,
input: TurnStartInput<'a>,
) -> ExtensionFuture<'a, ()>
fn on_turn_start<'a>( &'a self, input: TurnStartInput<'a>, ) -> ExtensionFuture<'a, ()>
Called after turn-scoped extension stores are created, before the task for the turn starts running.
Sourcefn on_turn_stop<'a>(
&'a self,
input: TurnStopInput<'a>,
) -> ExtensionFuture<'a, ()>
fn on_turn_stop<'a>( &'a self, input: TurnStopInput<'a>, ) -> ExtensionFuture<'a, ()>
Called before the host drops the completed turn runtime and turn store.
Sourcefn on_turn_abort<'a>(
&'a self,
input: TurnAbortInput<'a>,
) -> ExtensionFuture<'a, ()>
fn on_turn_abort<'a>( &'a self, input: TurnAbortInput<'a>, ) -> ExtensionFuture<'a, ()>
Called after the host aborts a running turn.
Sourcefn on_turn_error<'a>(
&'a self,
input: TurnErrorInput<'a>,
) -> ExtensionFuture<'a, ()>
fn on_turn_error<'a>( &'a self, input: TurnErrorInput<'a>, ) -> ExtensionFuture<'a, ()>
Called when the host observes an error for a running turn.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".