Skip to main content

ConversationStateAccess

Trait ConversationStateAccess 

Source
pub trait ConversationStateAccess {
    // Required methods
    fn messages(&self) -> &[Message];
    fn messages_mut(&mut self) -> &mut Vec<Message>;
    fn system_prompt(&self) -> &str;
}
Expand description

Trait for conversation state that memory management can operate on.

This decouples the memory module from any specific agent state representation. The agent’s ConversationState (e.g., in src/agent/state.rs) implements this trait.

Required Methods§

Source

fn messages(&self) -> &[Message]

Returns the current conversation messages as a slice.

Source

fn messages_mut(&mut self) -> &mut Vec<Message>

Returns a mutable reference to the messages vector for in-place compaction.

Source

fn system_prompt(&self) -> &str

Returns the system prompt string (first system message content).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§