pub struct Message {
pub id: i64,
pub session_id: String,
pub role: Role,
pub content: Option<String>,
pub tool_calls: Option<String>,
pub tool_call_id: Option<String>,
pub prompt_tokens: Option<i64>,
pub completion_tokens: Option<i64>,
pub cache_read_tokens: Option<i64>,
pub cache_creation_tokens: Option<i64>,
pub thinking_tokens: Option<i64>,
}Expand description
A stored message row.
Fields§
§id: i64Database row ID.
session_id: StringSession this message belongs to.
role: RoleMessage role (system, user, assistant, tool).
content: Option<String>Text content.
tool_calls: Option<String>Serialized tool calls JSON.
tool_call_id: Option<String>ID of the tool call this responds to.
prompt_tokens: Option<i64>Input tokens for this message.
completion_tokens: Option<i64>Output tokens for this message.
cache_read_tokens: Option<i64>Cached input tokens.
cache_creation_tokens: Option<i64>Tokens written to cache.
thinking_tokens: Option<i64>Reasoning/thinking tokens.
Trait Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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