pub struct ToolSessionControl { /* private fields */ }Implementations§
Source§impl ToolSessionControl
impl ToolSessionControl
pub async fn create_session( &self, request: SessionCreateRequest, ) -> Result<SessionHandle, PluginError>
pub async fn close_session(&self, session_id: &str) -> Result<(), PluginError>
pub async fn start_turn_stream( &self, session_id: &str, input: TurnInput, ) -> Result<SessionTurnHandle, PluginError>
pub async fn await_turn( &self, turn_id: &str, ) -> Result<AssembledTurn, PluginError>
pub async fn cancel_turn(&self, turn_id: &str) -> Result<(), PluginError>
Trait Implementations§
Source§impl Clone for ToolSessionControl
impl Clone for ToolSessionControl
Source§fn clone(&self) -> ToolSessionControl
fn clone(&self) -> ToolSessionControl
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl SessionLifecycleHost for ToolSessionControl
impl SessionLifecycleHost for ToolSessionControl
fn create_session<'life0, 'async_trait>(
&'life0 self,
request: SessionCreateRequest,
) -> Pin<Box<dyn Future<Output = Result<SessionHandle, PluginError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn close_session<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn take_first_turn_input<'life0, 'life1, 'async_trait>(
&'life0 self,
_session_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<PluginMessage>, PluginError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn take_first_turn_input<'life0, 'life1, 'async_trait>(
&'life0 self,
_session_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<PluginMessage>, PluginError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Pop the seed message that was queued for
session_id via
SessionCreateRequest::first_turn_input. Returns None if no
seed was queued, or after a previous caller has already taken
it. Hosts call this when starting the inaugural turn on a
freshly created session.Auto Trait Implementations§
impl Freeze for ToolSessionControl
impl !RefUnwindSafe for ToolSessionControl
impl Send for ToolSessionControl
impl Sync for ToolSessionControl
impl Unpin for ToolSessionControl
impl UnsafeUnpin for ToolSessionControl
impl !UnwindSafe for ToolSessionControl
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