pub struct SendMessage {
pub content: String,
pub recipient: String,
pub subject: Option<String>,
pub thread_ts: Option<String>,
pub cancellation_token: Option<CancellationToken>,
pub attachments: Vec<MediaAttachment>,
pub in_reply_to: Option<String>,
}Expand description
Message to send through a channel
Fields§
§content: String§recipient: String§subject: Option<String>§thread_ts: Option<String>Platform thread identifier for threaded replies (e.g. Slack thread_ts).
cancellation_token: Option<CancellationToken>Optional cancellation token for interruptible delivery (e.g. multi-message mode).
attachments: Vec<MediaAttachment>File attachments to send with the message. Channels that don’t support attachments ignore this field.
in_reply_to: Option<String>Message-ID to set as In-Reply-To header (email threading).
Implementations§
Source§impl SendMessage
impl SendMessage
Sourcepub fn new(
content: impl Into<String>,
recipient: impl Into<String>,
) -> SendMessage
pub fn new( content: impl Into<String>, recipient: impl Into<String>, ) -> SendMessage
Create a new message with content and recipient
Sourcepub fn with_subject(
content: impl Into<String>,
recipient: impl Into<String>,
subject: impl Into<String>,
) -> SendMessage
pub fn with_subject( content: impl Into<String>, recipient: impl Into<String>, subject: impl Into<String>, ) -> SendMessage
Create a new message with content, recipient, and subject
Sourcepub fn in_reply_to(self, msg_id: Option<String>) -> SendMessage
pub fn in_reply_to(self, msg_id: Option<String>) -> SendMessage
Set the In-Reply-To header for email threading.
Sourcepub fn subject(self, subject: impl Into<String>) -> SendMessage
pub fn subject(self, subject: impl Into<String>) -> SendMessage
Set the subject on an existing SendMessage (builder style).
Sourcepub fn in_thread(self, thread_ts: Option<String>) -> SendMessage
pub fn in_thread(self, thread_ts: Option<String>) -> SendMessage
Set the thread identifier for threaded replies.
Sourcepub fn with_cancellation(self, token: CancellationToken) -> SendMessage
pub fn with_cancellation(self, token: CancellationToken) -> SendMessage
Attach a cancellation token for interruptible delivery.
Sourcepub fn with_attachments(self, attachments: Vec<MediaAttachment>) -> SendMessage
pub fn with_attachments(self, attachments: Vec<MediaAttachment>) -> SendMessage
Attach files to this message.
Source§impl SendMessage
impl SendMessage
Sourcepub fn reply_to(msg: &ChannelMessage, content: impl Into<String>) -> SendMessage
pub fn reply_to(msg: &ChannelMessage, content: impl Into<String>) -> SendMessage
Build a reply SendMessage from an inbound ChannelMessage.
Sets recipient from msg.reply_target, threads via in_reply_to and
thread_ts, and prepends Re: to the subject when the inbound message
carried one. Safe to call from any channel handler; the in_reply_to
field is silently ignored by channels that don’t support it.
Trait Implementations§
Source§impl Clone for SendMessage
impl Clone for SendMessage
Source§fn clone(&self) -> SendMessage
fn clone(&self) -> SendMessage
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for SendMessage
impl RefUnwindSafe for SendMessage
impl Send for SendMessage
impl Sync for SendMessage
impl Unpin for SendMessage
impl UnsafeUnpin for SendMessage
impl UnwindSafe for SendMessage
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