pub struct SessionHookCustomizerAdapter { /* private fields */ }Expand description
Adapts a legacy SessionHook to the AgentCustomizer trait.
Constructs a synthetic CreateSessionRequest from the AgentBuildDraft,
lets the hook mutate it, and writes supported mutations back. Unsupported
field mutations (e.g., resume_session) are detected and logged as warnings.
Implementations§
Source§impl SessionHookCustomizerAdapter
impl SessionHookCustomizerAdapter
pub fn new(hook: Arc<dyn SessionHook>) -> Self
Trait Implementations§
Source§impl AgentCustomizer for SessionHookCustomizerAdapter
impl AgentCustomizer for SessionHookCustomizerAdapter
Source§fn customize_build<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_context: &'life1 AgentBuildContext,
spec: &'life2 DurableAgentSpec,
draft: &'life3 mut AgentBuildDraft,
) -> Pin<Box<dyn Future<Output = Result<(), CustomizerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn customize_build<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_context: &'life1 AgentBuildContext,
spec: &'life2 DurableAgentSpec,
draft: &'life3 mut AgentBuildDraft,
) -> Pin<Box<dyn Future<Output = Result<(), CustomizerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Customize the build draft for the given identity.
Source§fn after_create<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_identity: &'life1 AgentIdentity,
session_id: &'life2 SessionId,
context: &'life3 SessionCreatedContext,
) -> Pin<Box<dyn Future<Output = Result<(), CustomizerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn after_create<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_identity: &'life1 AgentIdentity,
session_id: &'life2 SessionId,
context: &'life3 SessionCreatedContext,
) -> Pin<Box<dyn Future<Output = Result<(), CustomizerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Called after a session is successfully created. Best-effort.
Auto Trait Implementations§
impl !RefUnwindSafe for SessionHookCustomizerAdapter
impl !UnwindSafe for SessionHookCustomizerAdapter
impl Freeze for SessionHookCustomizerAdapter
impl Send for SessionHookCustomizerAdapter
impl Sync for SessionHookCustomizerAdapter
impl Unpin for SessionHookCustomizerAdapter
impl UnsafeUnpin for SessionHookCustomizerAdapter
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more