pub enum AssistantSessionState {
Live,
Dormant,
Closed,
Ended,
}Expand description
What a session is, as the wire reports it — three answers and no more.
A PROJECTION, never a stored field, exactly as WorkflowStatus is: it is
derived from the session’s appended transcript records plus the live-process
registry. Nothing writes a state; things append records, and this is read off
them.
The states a UI might expect and will not find here are deliberate:
- “busy” is not a state. Whether a turn is open is what the transcript
already says, so a session cannot be busy on the wire and idle in its
frames. The refusal a caller needs — a second turn while one is open — is
a
409on the turn, not a state to render. - “not logged in” is not a state. It is the
auth_requiredcode on the turn that hit it, which names the turn it failed on; a session-wide state would claim the whole conversation was unusable when one turn was.
Variants§
Live
A harness process is running for this session right now.
Dormant
No process — but the harness advertised loadSession, so the
conversation is the harness’s OWN and can be reopened. The next turn
respawns it and opens with session/load, so a dormant session is
continuable and is never an error.
Closed
Shut by the caller, and reopenable: the harness advertised
loadSession and the conversation has a handle to load, so the next
turn respawns it exactly as a dormant one — but the caller chose to put
it away, so it is never the operator’s current session. Opening it
from history and typing is what brings it back.
Ended
Terminal and read-only: its harness cannot reload a prior conversation, so there is nothing left to return to — whether the process went on its own or the caller shut it.
Implementations§
Source§impl AssistantSessionState
impl AssistantSessionState
Sourcepub const fn is_continuable(self) -> bool
pub const fn is_continuable(self) -> bool
Whether another turn can be taken — now, or after a resume.
Sourcepub const fn is_current_candidate(self) -> bool
pub const fn is_current_candidate(self) -> bool
Whether this session may be the operator’s current one: continuable AND not put away. A closed session can still be reopened, but only by the operator choosing it — it never becomes current on its own.
Trait Implementations§
Source§impl Clone for AssistantSessionState
impl Clone for AssistantSessionState
Source§fn clone(&self) -> AssistantSessionState
fn clone(&self) -> AssistantSessionState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for AssistantSessionState
Source§impl Debug for AssistantSessionState
impl Debug for AssistantSessionState
Source§impl<'de> Deserialize<'de> for AssistantSessionState
impl<'de> Deserialize<'de> for AssistantSessionState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for AssistantSessionState
Source§impl Hash for AssistantSessionState
impl Hash for AssistantSessionState
Source§impl PartialEq for AssistantSessionState
impl PartialEq for AssistantSessionState
Source§impl Serialize for AssistantSessionState
impl Serialize for AssistantSessionState
impl StructuralPartialEq for AssistantSessionState
Source§impl TS for AssistantSessionState
impl TS for AssistantSessionState
Source§type WithoutGenerics = AssistantSessionState
type WithoutGenerics = AssistantSessionState
WithoutGenerics should just be Self.
If the type does have generic parameters, then all generic parameters must be replaced with
a dummy type, e.g ts_rs::Dummy or (). The only requirement for these dummy types is that
EXPORT_TO must be None. Read moreSource§type OptionInnerType = AssistantSessionState
type OptionInnerType = AssistantSessionState
std::option::Option<T>, then this associated type is set to T.
All other implementations of TS should set this type to Self instead.Source§fn docs() -> Option<String>
fn docs() -> Option<String>
TS is derived, docs are
automatically read from your doc comments or #[doc = ".."] attributesSource§fn decl_concrete(cfg: &Config) -> String
fn decl_concrete(cfg: &Config) -> String
TS::decl().
If this type is not generic, then this function is equivalent to TS::decl().Source§fn decl(cfg: &Config) -> String
fn decl(cfg: &Config) -> String
type User = { user_id: number, ... }.
This function will panic if the type has no declaration. Read moreSource§fn inline(cfg: &Config) -> String
fn inline(cfg: &Config) -> String
{ user_id: number }.
This function will panic if the type cannot be inlined.Source§fn inline_flattened(cfg: &Config) -> String
fn inline_flattened(cfg: &Config) -> String
Source§fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
Source§fn output_path() -> Option<PathBuf>
fn output_path() -> Option<PathBuf>
T should be exported, relative to the output directory.
The returned path does not include any base directory. Read moreSource§fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
Source§fn dependencies(cfg: &Config) -> Vec<Dependency>where
Self: 'static,
fn dependencies(cfg: &Config) -> Vec<Dependency>where
Self: 'static,
Source§fn export(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
fn export(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
TS::export_all. Read moreSource§fn export_all(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
fn export_all(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
TS::export. Read more