pub struct ReplState<'a> {
pub mode: &'a mut ReplMode,
pub sess: &'a mut Session,
pub ctx: &'a mut AgentContext,
pub history: &'a mut InputHistory,
pub conversation_messages: &'a mut Vec<Message>,
pub act_messages: &'a mut Vec<Message>,
pub coder_system_prompt: &'a str,
pub session_id: &'a str,
pub session_tracker: &'a SessionTracker,
pub last_user_message: &'a mut Option<String>,
}Expand description
Mutable REPL state passed to handle_command to keep the argument count low. For Rust learners: grouping related mutable references into a struct is a common pattern to avoid “too many arguments” and to keep function signatures readable and easy to extend.
Fields§
§mode: &'a mut ReplMode§sess: &'a mut Session§ctx: &'a mut AgentContext§history: &'a mut InputHistoryThe input history owned by the REPL main loop.
Passed here so /session etc can call history.push() if needed.
conversation_messages: &'a mut Vec<Message>§act_messages: &'a mut Vec<Message>§coder_system_prompt: &'a str§session_id: &'a strUsed by /undo to persist and pop stash entries across runs.
session_tracker: &'a SessionTrackerSession-level token tracker (accumulates across multiple task runs). Passed by reference so /tokens can display cumulative stats.
last_user_message: &'a mut Option<String>Last user message — used by /redo to re-send.
Auto Trait Implementations§
impl<'a> Freeze for ReplState<'a>
impl<'a> !RefUnwindSafe for ReplState<'a>
impl<'a> Send for ReplState<'a>
impl<'a> !Sync for ReplState<'a>
impl<'a> Unpin for ReplState<'a>
impl<'a> UnsafeUnpin for ReplState<'a>
impl<'a> !UnwindSafe for ReplState<'a>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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>
Converts
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>
Converts
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