struct SessionState {
thread_id: Option<String>,
turn_id: Option<String>,
phase: SessionPhase,
items: HashMap<String, ItemSnapshot>,
raw_unknown_events: VecDeque<Value>,
last_terminated_turn_id: Option<String>,
turn_starting: bool,
pending_requests: HashMap<RpcId, PendingServerRequest>,
}Fields§
§thread_id: Option<String>§turn_id: Option<String>§phase: SessionPhase§items: HashMap<String, ItemSnapshot>§raw_unknown_events: VecDeque<Value>§last_terminated_turn_id: Option<String>The most recently turn/completed-notified turn id. start_turn
checks this after its own turn/start response resolves — the
response and the completion notification arrive on independent
channels (the request/response oneshot vs. run_reader’s
notification stream), so a turn/completed for the SAME turn can
be applied before start_turn’s continuation resumes. Without this
check, start_turn’s unconditional post-await write would resurrect
an already-terminal turn as Running, permanently stuck (muxreview
P1, PR #3210). One id is enough, not a growing set: only one turn is
ever active at a time, so at most one termination can be “pending
recognition” by a not-yet-resumed start_turn call.
turn_starting: boolReserved atomically under the same lock as the turn_id.is_some()
check, before the turn/start request is even sent. Without this,
two concurrent start_turn calls both observe turn_id == None
and both release the lock before either gets a response/notification
back — nothing was reserved under the lock, so both send turn/start
(ReAgent P1, PR #3210). Cleared once the response (or an error)
resolves.
pending_requests: HashMap<RpcId, PendingServerRequest>Trait Implementations§
Source§impl Default for SessionState
impl Default for SessionState
Source§fn default() -> SessionState
fn default() -> SessionState
Auto Trait Implementations§
impl Freeze for SessionState
impl RefUnwindSafe for SessionState
impl Send for SessionState
impl Sync for SessionState
impl Unpin for SessionState
impl UnsafeUnpin for SessionState
impl UnwindSafe for SessionState
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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> ⓘ
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