[][src]Enum slack_blocks::compose::Text

pub enum Text {
    Markdown {
        text: String,
        verbatim: Option<bool>,
    },
    Plain {
        text: String,
        emoji: Option<bool>,
    },
}

Text Object

slack api docs 🔗

An object containing some text, formatted either as plain_text or using mrkdwn 🔗, our proprietary textual markup that's just different enough from Markdown to frustrate you.

Variants

Markdown

Markdown text

for more info, check out the slack api docs 🔗

Reserved Characters

Slack uses the following special characters, and recommends you HTML escape them like so:

➤ Click to expand
characterhow to escape
&&amp;
<&lt;
>&gt;

Basic Formatting

NOTE: This is not an exhaustive list

This should, however, capture most basic use cases without requiring that you check with the Slack documentation.

For more info, please visit Slack's docs for markdown formatting 🔗

➤ Click to expand
slack markdownformatted result
_italic_italic
*bold*bold
~strike~strike
\nline break
> a block quote
a block quote
`some code!`some code!
```multiline code\n2 lines!```multiline code
2 lines!
- li \n - li
  • li
  • li
<http://www.foo.com|link name>link name
:joy: (list from iamcal/emoji-data 🔗)😂
link to #channel: <#Cxxxxxx>#channel
link to @user: <@Uxxxxxx>@user
link to @user_group: <!subteam^xxxxxx>@user_group

Fields of Markdown

text: String

The text for the block.

This field accepts any of the standard text formatting markup

verbatim: Option<bool>

When set to false (as is default) URLs will be auto-converted into links, conversation names will be link-ified, and certain mentions will be automatically parsed.

Using a value of true will skip any preprocessing of this nature, although you can still include manual parsing strings.

Plain

Fields of Plain

text: String

The text for the block

emoji: Option<bool>

Indicates whether emojis in a text field should be escaped into the colon emoji format

Implementations

impl Text[src]

pub fn plain(text: String) -> Text[src]

pub fn markdown(text: String) -> Text[src]

pub fn text(&self) -> &str[src]

Trait Implementations

impl Clone for Text[src]

impl Debug for Text[src]

impl<'de> Deserialize<'de> for Text[src]

impl Serialize for Text[src]

Auto Trait Implementations

impl RefUnwindSafe for Text

impl Send for Text

impl Sync for Text

impl Unpin for Text

impl UnwindSafe for Text

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.