pub struct MessageRecord {
pub message_id: String,
pub thread_id: String,
pub seq: u64,
pub message: Message,
pub produced_by_run_id: Option<String>,
pub step_index: Option<u32>,
pub tool_call_id: Option<String>,
pub created_at: Option<u64>,
pub compaction: Option<CompactionMark>,
}Expand description
A message persisted as part of a thread’s append-only log.
Message remains the protocol payload. MessageRecord is the durable
thread-owned view that assigns a sequence number and exposes producer
relationships without making runs own message bodies.
Fields§
§message_id: StringStable message identifier.
thread_id: StringThread that owns the message.
seq: u641-based sequence number within the thread log.
message: MessageMessage payload.
produced_by_run_id: Option<String>Run that produced this message, if any.
step_index: Option<u32>Step that produced this message, if known.
tool_call_id: Option<String>Tool call this message responds to, if this is a tool result.
created_at: Option<u64>Unix timestamp (seconds) when the message was recorded.
compaction: Option<CompactionMark>When set, this record is a compaction summary that logically replaces the
committed message interval [from_seq, to_seq] in the effective view.
Originals are retained (append-only); see effective_messages.
Implementations§
Source§impl MessageRecord
impl MessageRecord
Sourcepub fn from_message(
thread_id: impl Into<String>,
seq: u64,
message: Message,
) -> MessageRecord
pub fn from_message( thread_id: impl Into<String>, seq: u64, message: Message, ) -> MessageRecord
Build a record from a thread-owned message payload.
Trait Implementations§
Source§impl Clone for MessageRecord
impl Clone for MessageRecord
Source§fn clone(&self) -> MessageRecord
fn clone(&self) -> MessageRecord
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MessageRecord
impl Debug for MessageRecord
Source§impl<'de> Deserialize<'de> for MessageRecord
impl<'de> Deserialize<'de> for MessageRecord
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<MessageRecord, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<MessageRecord, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for MessageRecord
impl Serialize for MessageRecord
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for MessageRecord
impl RefUnwindSafe for MessageRecord
impl Send for MessageRecord
impl Sync for MessageRecord
impl Unpin for MessageRecord
impl UnsafeUnpin for MessageRecord
impl UnwindSafe for MessageRecord
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