pub struct Message {
pub from: String,
pub content: String,
pub ts: i64,
pub id: Option<Uuid>,
pub reply_to: Option<Uuid>,
pub agent: bool,
pub tool: Option<ToolRecord>,
pub usage: Option<Usage>,
pub error: bool,
pub config: Option<ChatConfig>,
pub extra: Map<String, Value>,
}Fields§
§from: String§content: String§ts: i64§id: Option<Uuid>Unique per message. None on messages written before ids existed.
reply_to: Option<Uuid>The message this one follows: its parent in the conversation tree.
Sibling messages (same parent) are alternate timelines — edits and
regenerations append siblings rather than deleting. Uuid::nil()
means “first message” (no parent). None on messages written before
threading: their implicit parent is the preceding message in ts
order, so a legacy transcript reads as one linear chain.
agent: boolSent by from’s agent rather than typed by them. Agent messages
never trigger agent invocation.
tool: Option<ToolRecord>A tool round-trip by from’s agent; content is a short human
summary (“read_file /notes/todo.md”) for rendering. The record makes
the transcript the agent’s complete memory: reopening a chat replays
these into model context, so a restarted agent knows everything the
live one did.
usage: Option<Usage>On agent replies: token usage of the turn that produced this message. Chat-lifetime usage is the fold of these over the transcript.
error: boolA harness-level error (“rate limited”, “network down”) from from’s
agent. Rendered as a dim red row; excluded from agent context (the
model never saw it).
config: Option<ChatConfig>A from-authored configuration entry rather than a chat message (no
content). Carries this user’s per-chat agent settings; the latest by
ts wins. Excluded from rendering and from agent context.
extra: Map<String, Value>Fields this client doesn’t know about, preserved verbatim so a merge performed by an older client can’t strip them.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Message
impl<'de> Deserialize<'de> for Message
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>,
impl StructuralPartialEq for Message
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnsafeUnpin for Message
impl UnwindSafe for Message
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more