pub struct SlackAttachment {
pub fallback: Option<String>,
pub color: Option<String>,
pub pretext: Option<String>,
pub author_name: Option<String>,
pub author_link: Option<String>,
pub title: Option<String>,
pub title_link: Option<String>,
pub text: Option<String>,
pub fields: Vec<SlackField>,
pub footer: Option<String>,
pub ts: Option<i64>,
}Expand description
A Slack message attachment.
Fields§
§fallback: Option<String>Attachment fallback text.
color: Option<String>Attachment color (hex or named).
pretext: Option<String>Pretext shown above attachment.
Author name.
Author link.
title: Option<String>Attachment title.
title_link: Option<String>Title link.
text: Option<String>Main attachment text.
fields: Vec<SlackField>Attachment fields.
Footer text.
ts: Option<i64>Timestamp (Unix epoch).
Implementations§
Source§impl SlackAttachment
impl SlackAttachment
Sourcepub fn new() -> SlackAttachment
pub fn new() -> SlackAttachment
Create a new empty attachment.
Sourcepub fn color(self, color: impl Into<String>) -> SlackAttachment
pub fn color(self, color: impl Into<String>) -> SlackAttachment
Set the color.
Sourcepub fn title(self, title: impl Into<String>) -> SlackAttachment
pub fn title(self, title: impl Into<String>) -> SlackAttachment
Set the title.
Sourcepub fn title_link(self, link: impl Into<String>) -> SlackAttachment
pub fn title_link(self, link: impl Into<String>) -> SlackAttachment
Set the title link.
Sourcepub fn text(self, text: impl Into<String>) -> SlackAttachment
pub fn text(self, text: impl Into<String>) -> SlackAttachment
Set the text.
Sourcepub fn field(
self,
title: impl Into<String>,
value: impl Into<String>,
short: bool,
) -> SlackAttachment
pub fn field( self, title: impl Into<String>, value: impl Into<String>, short: bool, ) -> SlackAttachment
Add a field.
Set the footer.
Sourcepub fn timestamp(self, ts: i64) -> SlackAttachment
pub fn timestamp(self, ts: i64) -> SlackAttachment
Set the timestamp.
Trait Implementations§
Source§impl Clone for SlackAttachment
impl Clone for SlackAttachment
Source§fn clone(&self) -> SlackAttachment
fn clone(&self) -> SlackAttachment
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 SlackAttachment
impl Debug for SlackAttachment
Source§impl Default for SlackAttachment
impl Default for SlackAttachment
Source§fn default() -> SlackAttachment
fn default() -> SlackAttachment
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for SlackAttachment
impl<'de> Deserialize<'de> for SlackAttachment
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SlackAttachment, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SlackAttachment, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for SlackAttachment
impl Serialize for SlackAttachment
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for SlackAttachment
impl RefUnwindSafe for SlackAttachment
impl Send for SlackAttachment
impl Sync for SlackAttachment
impl Unpin for SlackAttachment
impl UnsafeUnpin for SlackAttachment
impl UnwindSafe for SlackAttachment
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> 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>
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