pub struct ClaudeProjector;Expand description
Project a ConversationView into a Claude Conversation.
Maps the provider-agnostic view back into Claude’s JSONL wire format. Assistant turns with tool uses will produce a separate tool-result user entry after each assistant entry (one entry per assistant turn that has tool uses with results).
§Example
use toolpath_claude::project::ClaudeProjector;
use toolpath_convo::{ConversationView, ConversationProjector};
let view = ConversationView {
id: "my-session".to_string(),
started_at: None,
last_activity: None,
turns: vec![],
total_usage: None,
provider_id: None,
files_changed: vec![],
session_ids: vec![],
events: vec![],
};
let projector = ClaudeProjector;
let convo = projector.project(&view).unwrap();
assert_eq!(convo.session_id, "my-session");Trait Implementations§
Source§impl ConversationProjector for ClaudeProjector
impl ConversationProjector for ClaudeProjector
Source§type Output = Conversation
type Output = Conversation
The type produced by projecting a
ConversationView.Source§fn project(&self, view: &ConversationView) -> Result<Conversation>
fn project(&self, view: &ConversationView) -> Result<Conversation>
Project
view into Self::Output.Auto Trait Implementations§
impl Freeze for ClaudeProjector
impl RefUnwindSafe for ClaudeProjector
impl Send for ClaudeProjector
impl Sync for ClaudeProjector
impl Unpin for ClaudeProjector
impl UnsafeUnpin for ClaudeProjector
impl UnwindSafe for ClaudeProjector
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more