Skip to main content

save_session

Function save_session 

Source
pub fn save_session(
    session: &Session,
    dir: &Path,
) -> Result<PathBuf, SessionError>
Expand description

Save a session to {dir}/{session_id}.json, creating dir if necessary.

Returns the path the file was written to.

This is the legacy sync entry point retained for backward compatibility. New code should prefer SessionStore + FileSystemSessionStore which adds advisory file locking and atomic rename semantics so concurrent writers cannot corrupt the session file.