pub struct HostSession { /* private fields */ }Expand description
One open conversation on a long-lived host.
Implementations§
Source§impl HostSession
impl HostSession
Sourcepub fn new(run: PreparedRun, approval: SessionApproval) -> Self
pub fn new(run: PreparedRun, approval: SessionApproval) -> Self
Opens a session with the approval state its host presents.
Sourcepub fn agent_id(&self) -> &str
pub fn agent_id(&self) -> &str
The persisted conversation id for this session: mentra’s agent id.
Sourcepub fn approval(&self) -> &SessionApproval
pub fn approval(&self) -> &SessionApproval
This conversation’s approval state, shared with its active turn.
Sourcepub async fn lock_turn(&self) -> MutexGuard<'_, PreparedRun>
pub async fn lock_turn(&self) -> MutexGuard<'_, PreparedRun>
Takes the turn lock. Held until the returned guard drops.
Sourcepub fn begin_turn(&self) -> TurnOptions
pub fn begin_turn(&self) -> TurnOptions
Arms a fresh cancellation token for a turn about to start.
Sourcepub fn interrupt(&self) -> Option<Interrupt>
pub fn interrupt(&self) -> Option<Interrupt>
The interrupt armed for the turn in flight, for whatever is about to
wait on the client on that turn’s behalf. None between turns.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for HostSession
impl !UnwindSafe for HostSession
impl Freeze for HostSession
impl Send for HostSession
impl Sync for HostSession
impl Unpin for HostSession
impl UnsafeUnpin for HostSession
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