Skip to main content

SessionPersistence

Trait SessionPersistence 

Source
pub trait SessionPersistence: Send + Sync {
    // Required methods
    fn create_session(
        &self,
        model: &str,
        cwd: &Path,
    ) -> Result<String, Box<dyn Error>>;
    fn update_title(
        &self,
        session_id: &str,
        title: &str,
    ) -> Result<(), Box<dyn Error>>;
    fn save_messages(
        &self,
        session_id: &str,
        messages: &[Message],
    ) -> Result<(), Box<dyn Error>>;
}
Expand description

Trait for session persistence, so the event handler doesn’t depend on rho-session directly.

Required Methods§

Source

fn create_session( &self, model: &str, cwd: &Path, ) -> Result<String, Box<dyn Error>>

Source

fn update_title( &self, session_id: &str, title: &str, ) -> Result<(), Box<dyn Error>>

Source

fn save_messages( &self, session_id: &str, messages: &[Message], ) -> Result<(), Box<dyn Error>>

Implementors§