pub trait CommandSessionExportContext {
// Required methods
fn conversation_projection(&self) -> ConversationExportProjection;
fn turn_handoff_projection(&self) -> TurnHandoffProjection;
fn clipboard_requires_terminal_paste(&self) -> bool;
fn write_recovery_copy(&self, markdown: &str) -> Option<PathBuf>;
fn write_clipboard(&self, markdown: &str) -> Result<(), String>;
fn resolve_export_path(&self, raw: &str) -> Result<PathBuf, String>;
fn write_export_file(
&self,
path: &Path,
contents: &[u8],
force: bool,
) -> Result<(), String>;
}Expand description
Session-export authority for the /export slice (FEAT-025 D1-D9).
Operation-granular synchronous delegates over the exact minimum host work
the command consumes. The portable handler parses the request first, renders
the selected scope second, and then uses these delegates in baseline order:
clipboard exports call terminal-paste detection, recovery write, and
clipboard delivery exactly once each with the same Markdown; file exports
resolve the destination before writing it. A recovery-write None never
prevents the clipboard attempt, and a turn-only export never requests the
conversation projection (D6/D7).
Required Methods§
Sourcefn conversation_projection(&self) -> ConversationExportProjection
fn conversation_projection(&self) -> ConversationExportProjection
Conversation export projection: metadata, authoritative-or-fallback transcript, and restore-point state. Read-only; opens only an existing snapshot repository and never creates one (D8).
Sourcefn turn_handoff_projection(&self) -> TurnHandoffProjection
fn turn_handoff_projection(&self) -> TurnHandoffProjection
Turn-handoff projection: unmodified shared renderer Markdown plus the workspace path value (D2).
Sourcefn clipboard_requires_terminal_paste(&self) -> bool
fn clipboard_requires_terminal_paste(&self) -> bool
Whether clipboard delivery goes through the terminal-client (SSH/OSC 52 via tmux) path (D6).
Sourcefn write_recovery_copy(&self, markdown: &str) -> Option<PathBuf>
fn write_recovery_copy(&self, markdown: &str) -> Option<PathBuf>
Write the shared last-copy.md recovery file. None reproduces the
baseline silent failure; recovery writing never falls through to an
error (D5/D6).
Sourcefn write_clipboard(&self, markdown: &str) -> Result<(), String>
fn write_clipboard(&self, markdown: &str) -> Result<(), String>
Attempt clipboard delivery. Err carries the raw host clipboard error
text; the handler composes the exact failure wording (D6).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".