pub enum Entry {
Message {
id: Id,
parent: Option<Id>,
message: Message,
},
Assistant {
id: Id,
parent: Option<Id>,
turn: Turn,
},
Result {
id: Id,
parent: Option<Id>,
result: ToolResult,
},
Compaction {
id: Id,
parent: Option<Id>,
summary: String,
},
Rewind {
id: Id,
parent: Option<Id>,
to: Id,
},
Model {
id: Id,
parent: Option<Id>,
model: String,
},
}Expand description
One line of a session file.
Variants§
Message
Assistant
Result
Compaction
Shadows everything before it on the branch.
A summary is an entry rather than an edit so that compaction costs one append and the original messages stay on disk.
Rewind
Moves the head back to an earlier entry.
Appended rather than applied by deletion, so what the model was told before the rewind is still readable afterwards.
Model
The model this conversation switched to, from this point on.
An entry rather than a header field, because the model is chosen partway
through a session and the file is append-only. The last one on the active
branch is the model in force; see SessionLog::active_model. Nothing in the
conversation reads it, so entry_to_message drops it.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Entry
impl<'de> Deserialize<'de> for Entry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Entry
impl StructuralPartialEq for Entry
Auto Trait Implementations§
impl Forget for Entry
impl Freeze for Entry
impl Move for Entry
impl RefUnwindSafe for Entry
impl Send for Entrywhere
RawVecInner: Send,
impl Sync for Entrywhere
RawVecInner: Sync,
impl Unpin for Entry
impl UnsafeUnpin for Entrywhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<AssistantToolCall>: UnsafeUnpin,
impl UnwindSafe for Entrywhere
RawVecInner: 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