pub struct SlackMessage {
pub text: String,
pub channel: Option<String>,
pub username: Option<String>,
pub icon_emoji: Option<String>,
pub icon_url: Option<String>,
pub attachments: Vec<SlackAttachment>,
}Expand description
A Slack message for webhook notifications.
Fields§
§text: StringMain message text.
channel: Option<String>Optional channel override.
username: Option<String>Optional username override.
icon_emoji: Option<String>Optional icon emoji (e.g., “:rocket:”).
icon_url: Option<String>Optional icon URL.
attachments: Vec<SlackAttachment>Message attachments.
Implementations§
Source§impl SlackMessage
impl SlackMessage
Sourcepub fn icon_emoji(self, emoji: impl Into<String>) -> Self
pub fn icon_emoji(self, emoji: impl Into<String>) -> Self
Set the icon emoji.
Sourcepub fn attachment(self, attachment: SlackAttachment) -> Self
pub fn attachment(self, attachment: SlackAttachment) -> Self
Add an attachment.
Trait Implementations§
Source§impl Clone for SlackMessage
impl Clone for SlackMessage
Source§fn clone(&self) -> SlackMessage
fn clone(&self) -> SlackMessage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SlackMessage
impl Debug for SlackMessage
Source§impl Default for SlackMessage
impl Default for SlackMessage
Source§fn default() -> SlackMessage
fn default() -> SlackMessage
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for SlackMessage
impl<'de> Deserialize<'de> for SlackMessage
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
Auto Trait Implementations§
impl Freeze for SlackMessage
impl RefUnwindSafe for SlackMessage
impl Send for SlackMessage
impl Sync for SlackMessage
impl Unpin for SlackMessage
impl UnsafeUnpin for SlackMessage
impl UnwindSafe for SlackMessage
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