pub struct TurnControl { /* private fields */ }Expand description
Cheap cloneable control capability for one accepted turn.
Implementations§
Source§impl TurnControl
impl TurnControl
Sourcepub async fn steer(&self, prompt: impl Into<Prompt>) -> Result<()>
pub async fn steer(&self, prompt: impl Into<Prompt>) -> Result<()>
Injects additional input into the targeted turn.
§Errors
Returns an error for an empty prompt, when the turn is not active, when its steering queue is full, or if the driver stops.
Sourcepub async fn steer_with_id(
&self,
id: String,
prompt: impl Into<Prompt>,
) -> Result<()>
pub async fn steer_with_id( &self, id: String, prompt: impl Into<Prompt>, ) -> Result<()>
Admits input with a caller-owned identity unique within this turn.
§Errors
Returns admission errors or an error if identified steering is unsupported.
Sourcepub async fn withdraw_steer(&self, id: String) -> Result<bool>
pub async fn withdraw_steer(&self, id: String) -> Result<bool>
Withdraws the latest accepted steer before its model boundary. Returns false if the identity is no longer latest or was already consumed.
§Errors
Returns an error if persistence fails, the driver stops, or withdrawal is unsupported.
Trait Implementations§
Source§impl Clone for TurnControl
impl Clone for TurnControl
Source§fn clone(&self) -> TurnControl
fn clone(&self) -> TurnControl
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 TurnControl
impl !UnwindSafe for TurnControl
impl Freeze for TurnControl
impl Send for TurnControl
impl Sync for TurnControl
impl Unpin for TurnControl
impl UnsafeUnpin for TurnControl
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.