pub struct SlackMessageContent {
pub text: Option<String>,
pub markdown_text: Option<String>,
pub blocks: Option<Vec<SlackBlock>>,
pub attachments: Option<Vec<SlackMessageAttachment>>,
pub upload: Option<bool>,
pub files: Option<Vec<SlackFile>>,
pub reactions: Option<Vec<SlackReaction>>,
pub metadata: Option<SlackMessageMetadata>,
}Fields§
§text: Option<String>§markdown_text: Option<String>Standard markdown rendered by Slack; not combinable with text/blocks; ≤ 12 000 chars.
https://docs.slack.dev/messaging/formatting-message-text#markdown-text
Write-only: Slack never returns it on received messages; it appears in inbound message models only because the content struct is shared.
blocks: Option<Vec<SlackBlock>>§attachments: Option<Vec<SlackMessageAttachment>>§upload: Option<bool>§files: Option<Vec<SlackFile>>§reactions: Option<Vec<SlackReaction>>§metadata: Option<SlackMessageMetadata>Implementations§
Source§impl SlackMessageContent
impl SlackMessageContent
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new SlackMessageContent from its required fields. Option fields start as None, and fields with #[default] take their default.
Sourcepub fn reset_text(&mut self) -> &mut Self
pub fn reset_text(&mut self) -> &mut Self
Sets text to None.
Sourcepub fn without_text(self) -> Self
pub fn without_text(self) -> Self
Returns self with text set to None.
Sourcepub fn opt_text(self, value: Option<String>) -> Self
pub fn opt_text(self, value: Option<String>) -> Self
Returns self with text set to the given Option.
Sourcepub fn markdown_text(&mut self, value: String) -> &mut Self
pub fn markdown_text(&mut self, value: String) -> &mut Self
Sets markdown_text to Some(value).
Standard markdown rendered by Slack; not combinable with text/blocks; ≤ 12 000 chars.
https://docs.slack.dev/messaging/formatting-message-text#markdown-text
Write-only: Slack never returns it on received messages; it appears in inbound message models only because the content struct is shared.
Sourcepub fn reset_markdown_text(&mut self) -> &mut Self
pub fn reset_markdown_text(&mut self) -> &mut Self
Sets markdown_text to None.
Standard markdown rendered by Slack; not combinable with text/blocks; ≤ 12 000 chars.
https://docs.slack.dev/messaging/formatting-message-text#markdown-text
Write-only: Slack never returns it on received messages; it appears in inbound message models only because the content struct is shared.
Sourcepub fn mopt_markdown_text(&mut self, value: Option<String>) -> &mut Self
pub fn mopt_markdown_text(&mut self, value: Option<String>) -> &mut Self
Sets markdown_text to the given Option.
Standard markdown rendered by Slack; not combinable with text/blocks; ≤ 12 000 chars.
https://docs.slack.dev/messaging/formatting-message-text#markdown-text
Write-only: Slack never returns it on received messages; it appears in inbound message models only because the content struct is shared.
Sourcepub fn with_markdown_text(self, value: String) -> Self
pub fn with_markdown_text(self, value: String) -> Self
Returns self with markdown_text set to Some(value).
Standard markdown rendered by Slack; not combinable with text/blocks; ≤ 12 000 chars.
https://docs.slack.dev/messaging/formatting-message-text#markdown-text
Write-only: Slack never returns it on received messages; it appears in inbound message models only because the content struct is shared.
Sourcepub fn without_markdown_text(self) -> Self
pub fn without_markdown_text(self) -> Self
Returns self with markdown_text set to None.
Standard markdown rendered by Slack; not combinable with text/blocks; ≤ 12 000 chars.
https://docs.slack.dev/messaging/formatting-message-text#markdown-text
Write-only: Slack never returns it on received messages; it appears in inbound message models only because the content struct is shared.
Sourcepub fn opt_markdown_text(self, value: Option<String>) -> Self
pub fn opt_markdown_text(self, value: Option<String>) -> Self
Returns self with markdown_text set to the given Option.
Standard markdown rendered by Slack; not combinable with text/blocks; ≤ 12 000 chars.
https://docs.slack.dev/messaging/formatting-message-text#markdown-text
Write-only: Slack never returns it on received messages; it appears in inbound message models only because the content struct is shared.
Sourcepub fn blocks(&mut self, value: Vec<SlackBlock>) -> &mut Self
pub fn blocks(&mut self, value: Vec<SlackBlock>) -> &mut Self
Sets blocks to Some(value).
Sourcepub fn reset_blocks(&mut self) -> &mut Self
pub fn reset_blocks(&mut self) -> &mut Self
Sets blocks to None.
Sourcepub fn mopt_blocks(&mut self, value: Option<Vec<SlackBlock>>) -> &mut Self
pub fn mopt_blocks(&mut self, value: Option<Vec<SlackBlock>>) -> &mut Self
Sets blocks to the given Option.
Sourcepub fn with_blocks(self, value: Vec<SlackBlock>) -> Self
pub fn with_blocks(self, value: Vec<SlackBlock>) -> Self
Returns self with blocks set to Some(value).
Sourcepub fn without_blocks(self) -> Self
pub fn without_blocks(self) -> Self
Returns self with blocks set to None.
Sourcepub fn opt_blocks(self, value: Option<Vec<SlackBlock>>) -> Self
pub fn opt_blocks(self, value: Option<Vec<SlackBlock>>) -> Self
Returns self with blocks set to the given Option.
Sourcepub fn attachments(&mut self, value: Vec<SlackMessageAttachment>) -> &mut Self
pub fn attachments(&mut self, value: Vec<SlackMessageAttachment>) -> &mut Self
Sets attachments to Some(value).
Sourcepub fn reset_attachments(&mut self) -> &mut Self
pub fn reset_attachments(&mut self) -> &mut Self
Sets attachments to None.
Sourcepub fn mopt_attachments(
&mut self,
value: Option<Vec<SlackMessageAttachment>>,
) -> &mut Self
pub fn mopt_attachments( &mut self, value: Option<Vec<SlackMessageAttachment>>, ) -> &mut Self
Sets attachments to the given Option.
Sourcepub fn with_attachments(self, value: Vec<SlackMessageAttachment>) -> Self
pub fn with_attachments(self, value: Vec<SlackMessageAttachment>) -> Self
Returns self with attachments set to Some(value).
Sourcepub fn without_attachments(self) -> Self
pub fn without_attachments(self) -> Self
Returns self with attachments set to None.
Sourcepub fn opt_attachments(self, value: Option<Vec<SlackMessageAttachment>>) -> Self
pub fn opt_attachments(self, value: Option<Vec<SlackMessageAttachment>>) -> Self
Returns self with attachments set to the given Option.
Sourcepub fn reset_upload(&mut self) -> &mut Self
pub fn reset_upload(&mut self) -> &mut Self
Sets upload to None.
Sourcepub fn mopt_upload(&mut self, value: Option<bool>) -> &mut Self
pub fn mopt_upload(&mut self, value: Option<bool>) -> &mut Self
Sets upload to the given Option.
Sourcepub fn with_upload(self, value: bool) -> Self
pub fn with_upload(self, value: bool) -> Self
Returns self with upload set to Some(value).
Sourcepub fn without_upload(self) -> Self
pub fn without_upload(self) -> Self
Returns self with upload set to None.
Sourcepub fn opt_upload(self, value: Option<bool>) -> Self
pub fn opt_upload(self, value: Option<bool>) -> Self
Returns self with upload set to the given Option.
Sourcepub fn reset_files(&mut self) -> &mut Self
pub fn reset_files(&mut self) -> &mut Self
Sets files to None.
Sourcepub fn mopt_files(&mut self, value: Option<Vec<SlackFile>>) -> &mut Self
pub fn mopt_files(&mut self, value: Option<Vec<SlackFile>>) -> &mut Self
Sets files to the given Option.
Sourcepub fn with_files(self, value: Vec<SlackFile>) -> Self
pub fn with_files(self, value: Vec<SlackFile>) -> Self
Returns self with files set to Some(value).
Sourcepub fn without_files(self) -> Self
pub fn without_files(self) -> Self
Returns self with files set to None.
Sourcepub fn opt_files(self, value: Option<Vec<SlackFile>>) -> Self
pub fn opt_files(self, value: Option<Vec<SlackFile>>) -> Self
Returns self with files set to the given Option.
Sourcepub fn reactions(&mut self, value: Vec<SlackReaction>) -> &mut Self
pub fn reactions(&mut self, value: Vec<SlackReaction>) -> &mut Self
Sets reactions to Some(value).
Sourcepub fn reset_reactions(&mut self) -> &mut Self
pub fn reset_reactions(&mut self) -> &mut Self
Sets reactions to None.
Sourcepub fn mopt_reactions(&mut self, value: Option<Vec<SlackReaction>>) -> &mut Self
pub fn mopt_reactions(&mut self, value: Option<Vec<SlackReaction>>) -> &mut Self
Sets reactions to the given Option.
Sourcepub fn with_reactions(self, value: Vec<SlackReaction>) -> Self
pub fn with_reactions(self, value: Vec<SlackReaction>) -> Self
Returns self with reactions set to Some(value).
Sourcepub fn without_reactions(self) -> Self
pub fn without_reactions(self) -> Self
Returns self with reactions set to None.
Sourcepub fn opt_reactions(self, value: Option<Vec<SlackReaction>>) -> Self
pub fn opt_reactions(self, value: Option<Vec<SlackReaction>>) -> Self
Returns self with reactions set to the given Option.
Sourcepub fn metadata(&mut self, value: SlackMessageMetadata) -> &mut Self
pub fn metadata(&mut self, value: SlackMessageMetadata) -> &mut Self
Sets metadata to Some(value).
Sourcepub fn reset_metadata(&mut self) -> &mut Self
pub fn reset_metadata(&mut self) -> &mut Self
Sets metadata to None.
Sourcepub fn mopt_metadata(
&mut self,
value: Option<SlackMessageMetadata>,
) -> &mut Self
pub fn mopt_metadata( &mut self, value: Option<SlackMessageMetadata>, ) -> &mut Self
Sets metadata to the given Option.
Sourcepub fn with_metadata(self, value: SlackMessageMetadata) -> Self
pub fn with_metadata(self, value: SlackMessageMetadata) -> Self
Returns self with metadata set to Some(value).
Sourcepub fn without_metadata(self) -> Self
pub fn without_metadata(self) -> Self
Returns self with metadata set to None.
Sourcepub fn opt_metadata(self, value: Option<SlackMessageMetadata>) -> Self
pub fn opt_metadata(self, value: Option<SlackMessageMetadata>) -> Self
Returns self with metadata set to the given Option.