pub struct NativeTurn {
pub supercode_turn: u8,
pub ts: String,
pub role: Role,
pub content: Option<String>,
pub content_parts: Option<Vec<Value>>,
pub tool_calls: Option<Vec<ToolCall>>,
pub tool_call_id: Option<String>,
pub name: Option<String>,
pub metadata: BTreeMap<String, String>,
}Expand description
One appended-after-import conversation turn, as written to a native-v2 sidecar file (one JSON object per line, following the imported body).
Discriminated by Self::supercode_turn so the tolerant per-source
parsers (Session::from_claude_code_str, Session::from_codex_str) skip
it as an unrecognized record rather than erroring — neither format’s
records carry a supercode_turn key, type, or payload.
Fields§
§supercode_turn: u8Discriminant identifying this line as a NativeTurn record. Always 1.
ts: StringRFC3339 (UTC) timestamp of when the turn was appended.
role: RoleMirrors ChatMessage::role.
content: Option<String>Mirrors ChatMessage::content.
content_parts: Option<Vec<Value>>Mirrors ChatMessage::content_parts.
tool_calls: Option<Vec<ToolCall>>Mirrors ChatMessage::tool_calls.
tool_call_id: Option<String>Mirrors ChatMessage::tool_call_id.
name: Option<String>Mirrors ChatMessage::name.
metadata: BTreeMap<String, String>Mirrors ChatMessage::metadata — but UNLIKE ChatMessage’s wire
Serialize (which omits it, message.rs:53-54/57-79), it serializes
in full here. This is the whole reason NativeTurn exists rather than
reusing ChatMessage’s own (de)serializer: the sidecar must retain
what the wire serde must drop.
Implementations§
Source§impl NativeTurn
impl NativeTurn
Sourcepub fn into_message(self) -> ChatMessage
pub fn into_message(self) -> ChatMessage
Recover the plain ChatMessage this record represents, discarding
the supercode_turn/ts sidecar framing (which have no ChatMessage
slot).
Trait Implementations§
Source§impl Clone for NativeTurn
impl Clone for NativeTurn
Source§fn clone(&self) -> NativeTurn
fn clone(&self) -> NativeTurn
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more