pub struct InteractionHandle { /* private fields */ }Expand description
Handle to an Interaction, usable for get / cancel / delete / poll operations.
Implementations§
Source§impl InteractionHandle
impl InteractionHandle
Sourcepub async fn get(&self) -> Result<Interaction, Error>
pub async fn get(&self) -> Result<Interaction, Error>
Get the full interaction resource.
Sourcepub async fn get_stream(
&self,
last_event_id: Option<&str>,
) -> Result<InteractionStream, Error>
pub async fn get_stream( &self, last_event_id: Option<&str>, ) -> Result<InteractionStream, Error>
Get the interaction in streaming mode (can resume from last_event_id).
Sourcepub async fn cancel(&self) -> Result<Interaction, Error>
pub async fn cancel(&self) -> Result<Interaction, Error>
Cancel the interaction (only applicable to background executions).
Sourcepub async fn poll_until_completed(
&self,
interval: Duration,
) -> Result<Interaction, Error>
pub async fn poll_until_completed( &self, interval: Duration, ) -> Result<Interaction, Error>
Poll until the interaction reaches a terminal state.
Continuously calls get() until the status becomes
completed / failed / cancelled / incomplete / budget_exceeded.
Suitable for background interactions.
Sourcepub fn as_previous_interaction_id(&self) -> &str
pub fn as_previous_interaction_id(&self) -> &str
Get this interaction’s ID for use as previous_interaction_id in the next turn.
Trait Implementations§
Source§impl Clone for InteractionHandle
impl Clone for InteractionHandle
Source§fn clone(&self) -> InteractionHandle
fn clone(&self) -> InteractionHandle
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 moreAuto Trait Implementations§
impl !RefUnwindSafe for InteractionHandle
impl !UnwindSafe for InteractionHandle
impl Freeze for InteractionHandle
impl Send for InteractionHandle
impl Sync for InteractionHandle
impl Unpin for InteractionHandle
impl UnsafeUnpin for InteractionHandle
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