pub struct Message {
pub session_id: String,
pub role: String,
pub content: String,
pub timestamp: DateTime<Utc>,
pub branch: Option<String>,
pub line_number: usize,
pub uuid: Option<String>,
pub parent_uuid: Option<String>,
}Expand description
Represents a message from Claude Code JSONL session
Fields§
§session_id: String§role: String§content: String§timestamp: DateTime<Utc>§branch: Option<String>§line_number: usize§uuid: Option<String>§parent_uuid: Option<String>Implementations§
Source§impl Message
impl Message
Sourcepub fn from_jsonl(line: &str, line_number: usize) -> Option<Self>
pub fn from_jsonl(line: &str, line_number: usize) -> Option<Self>
Parse a JSONL line into a Message Supports both Claude Code CLI format (sessionId, timestamp) and Claude Desktop format (session_id, _audit_timestamp)
Sourcepub fn extract_content(raw: &Value) -> String
pub fn extract_content(raw: &Value) -> String
Extract text content from message content blocks Handles both array format [{“type”:“text”,“text”:“…”}] and plain string format
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>,
Deserialize this value from the given Serde deserializer. Read more
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
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> 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