pub struct ChannelMessage {
pub id: String,
pub sender: String,
pub reply_target: String,
pub content: String,
pub channel: String,
pub channel_alias: Option<String>,
pub timestamp: u64,
pub thread_ts: Option<String>,
pub interruption_scope_id: Option<String>,
pub attachments: Vec<MediaAttachment>,
pub subject: Option<String>,
}Expand description
A message received from or sent to a channel
Fields§
§id: String§sender: String§reply_target: String§content: String§channel: String§channel_alias: Option<String>ZeroClaw channel alias (the <alias> half of [channels.<type>.<alias>])
when the platform supports multiple bot instances. Used by
session_key construction so two bots on the same platform compute
distinct session IDs and don’t share conversation history. None
for channels that don’t have an alias concept yet (webhook, cli).
timestamp: u64§thread_ts: Option<String>Platform thread identifier (e.g. Slack ts, Discord thread ID).
When set, replies should be posted as threaded responses.
interruption_scope_id: Option<String>Thread scope identifier for interruption/cancellation grouping.
Distinct from thread_ts (reply anchor): this is Some only when the message
is genuinely inside a reply thread and should be isolated from other threads.
None means top-level — scope is sender+channel only.
attachments: Vec<MediaAttachment>Media attachments (audio, images, video) for the media pipeline. Channels populate this when they receive media alongside a text message. Defaults to empty — existing channels are unaffected.
subject: Option<String>Email subject for reply threading.
Implementations§
Source§impl ChannelMessage
impl ChannelMessage
Sourcepub fn new(
id: impl Into<String>,
sender: impl Into<String>,
reply_target: impl Into<String>,
content: impl Into<String>,
channel: impl Into<String>,
timestamp: u64,
) -> ChannelMessage
pub fn new( id: impl Into<String>, sender: impl Into<String>, reply_target: impl Into<String>, content: impl Into<String>, channel: impl Into<String>, timestamp: u64, ) -> ChannelMessage
Construct a ChannelMessage with all required fields set and all optional
fields zeroed. Prefer this over raw struct literals so that new optional
fields added to ChannelMessage in the future don’t require mechanical
updates at every call site.
Trait Implementations§
Source§impl Clone for ChannelMessage
impl Clone for ChannelMessage
Source§fn clone(&self) -> ChannelMessage
fn clone(&self) -> ChannelMessage
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ChannelMessage
impl Debug for ChannelMessage
Source§impl Default for ChannelMessage
impl Default for ChannelMessage
Source§fn default() -> ChannelMessage
fn default() -> ChannelMessage
Auto Trait Implementations§
impl Freeze for ChannelMessage
impl RefUnwindSafe for ChannelMessage
impl Send for ChannelMessage
impl Sync for ChannelMessage
impl Unpin for ChannelMessage
impl UnsafeUnpin for ChannelMessage
impl UnwindSafe for ChannelMessage
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> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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