pub struct InboxMessage {
pub id: String,
pub from: String,
pub to: String,
pub content: String,
pub summary: Option<String>,
pub timestamp: DateTime<Utc>,
pub read: bool,
pub color: Option<String>,
}Expand description
A message stored in an agent’s inbox file.
The content field serializes as "content" but also accepts "text"
(Claude Code’s native key name) during deserialization.
Fields§
§id: StringUnique message ID (library extension — absent in native format). Defaults to empty string when parsing native messages without an ID.
from: StringSender agent name.
to: StringRecipient agent name (library extension — absent in native format; the recipient is implicit from the inbox file name). Defaults to empty string when parsing native messages.
content: StringPlain-text content (may also carry structured JSON).
Serializes as "content", deserializes from "content" or "text".
summary: Option<String>Summary for UI preview (5-10 word description).
timestamp: DateTime<Utc>ISO 8601 timestamp.
read: boolWhether the message has been read.
color: Option<String>Sender’s UI color hint (e.g. "blue", "green", "yellow").
Implementations§
Source§impl InboxMessage
impl InboxMessage
Sourcepub fn new(
from: impl Into<String>,
to: impl Into<String>,
content: impl Into<String>,
) -> Self
pub fn new( from: impl Into<String>, to: impl Into<String>, content: impl Into<String>, ) -> Self
Create a new plain-text message.
Sourcepub fn from_structured(
from: impl Into<String>,
to: impl Into<String>,
msg: &StructuredMessage,
) -> Result<Self>
pub fn from_structured( from: impl Into<String>, to: impl Into<String>, msg: &StructuredMessage, ) -> Result<Self>
Create a message from a structured payload.
Sourcepub fn try_as_structured(&self) -> Option<StructuredMessage>
pub fn try_as_structured(&self) -> Option<StructuredMessage>
Try to parse the content as a structured message.
Trait Implementations§
Source§impl Clone for InboxMessage
impl Clone for InboxMessage
Source§fn clone(&self) -> InboxMessage
fn clone(&self) -> InboxMessage
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for InboxMessage
impl Debug for InboxMessage
Source§impl<'de> Deserialize<'de> for InboxMessage
impl<'de> Deserialize<'de> for InboxMessage
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>,
Auto Trait Implementations§
impl Freeze for InboxMessage
impl RefUnwindSafe for InboxMessage
impl Send for InboxMessage
impl Sync for InboxMessage
impl Unpin for InboxMessage
impl UnwindSafe for InboxMessage
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,
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