pub struct Conversation {
pub path: PathBuf,
/* private fields */
}Expand description
A saved conversation, read whole.
Fields§
§path: PathBufImplementations§
Source§impl Conversation
impl Conversation
Sourcepub fn load(path: &Path) -> Result<Option<Self>, String>
pub fn load(path: &Path) -> Result<Option<Self>, String>
Read a session file; None when it does not exist. A last line cut short by a crash
is left out.
Sourcepub fn history(&self) -> Result<Vec<Message>, String>
pub fn history(&self) -> Result<Vec<Message>, String>
Every message in order, the review’s and its follow-ups’, ready to send again. Tool
calls anywhere in the history whose turn stopped before answering get an error result
right after that assistant message, preserving any already-recorded ToolOutcome results
so an interrupted follow-up never drops saved tool outcomes or sends unanswered
ToolCalls to Anthropic/OpenAI.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Conversation
impl Freeze for Conversation
impl Move for Conversation
impl RefUnwindSafe for Conversation
impl Send for Conversationwhere
RawVecInner: Send,
BoxRaw<Header>: Send,
NonZero<i32>: Send,
NodeRef<Owned, String, Value, LeafOrInternal>: Send,
BoxRaw<(String, Value)>: Send,
&'static str: Send,
String: Send,
NodeRef<Owned, usize, BuiltinTarget, LeafOrInternal>: Send,
BoxRaw<(usize, BuiltinTarget)>: Send,
NodeRef<Owned, String, u64, LeafOrInternal>: Send,
BoxRaw<(String, u64)>: Send,
BoxRaw<RawValue>: Send,
impl Sync for Conversationwhere
RawVecInner: Sync,
BoxRaw<Header>: Sync,
NonZero<i32>: Sync,
NodeRef<Owned, String, Value, LeafOrInternal>: Sync,
BoxRaw<(String, Value)>: Sync,
String: Sync,
NodeRef<Owned, usize, BuiltinTarget, LeafOrInternal>: Sync,
BoxRaw<(usize, BuiltinTarget)>: Sync,
NodeRef<Owned, String, u64, LeafOrInternal>: Sync,
BoxRaw<(String, u64)>: Sync,
BoxRaw<RawValue>: Sync,
impl Unpin for Conversationwhere
*const u8 is !null: Unpin,
Box<Header>: Unpin,
NonZero<i32>: Unpin,
*const LeafNode<String, Value> is !null: Unpin,
Box<(String, Value)>: Unpin,
&'static str: Unpin,
String: Unpin,
*const LeafNode<usize, BuiltinTarget> is !null: Unpin,
Box<(usize, BuiltinTarget)>: Unpin,
*const LeafNode<String, u64> is !null: Unpin,
Box<(String, u64)>: Unpin,
Box<RawValue>: Unpin,
impl UnsafeUnpin for Conversationwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const Header is !null: UnsafeUnpin,
PhantomData<Header>: UnsafeUnpin,
NonZeroI32Inner: UnsafeUnpin,
PhantomData<Event>: UnsafeUnpin,
PhantomData<Box<RawValue>>: UnsafeUnpin,
impl UnwindSafe for Conversationwhere
RawVecInner: UnwindSafe,
BoxRaw<Header>: UnwindSafe,
NonZero<i32>: UnwindSafe,
BTreeMap<String, Value>: UnwindSafe,
&'static str: UnwindSafe,
String: UnwindSafe,
BTreeMap<usize, BuiltinTarget>: UnwindSafe,
BTreeMap<String, u64>: UnwindSafe,
BoxRaw<RawValue>: UnwindSafe,
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