[][src]Struct slack_blocks::compose::text::plain::Contents

pub struct Contents { /* fields omitted */ }

Literally just plain text, with the only formatting available being emojis.

Implementations

impl Contents[src]

pub fn from_text(text: impl ToString) -> Self[src]

Construct some markdown text from a string or string-like value

Arguments

  • text - The text contents to render for this Text object. For some basic formatting examples, see the docs above for the Contents struct itself, or Slack's markdown docs 🔗. There are no intrinsic length limits on this, those are usually requirements of the context the text will be used in.

Example

use slack_blocks::compose::text::{mrkdwn, Text};

let text = mrkdwn::Contents::from_text("This link doesn't work! :tada: https://www.cheese.com")
    .with_verbatim(true);

pub fn with_emoji(self, emoji: bool) -> Self[src]

Sets the emoji flag

Arguments

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

Example

use slack_blocks::compose::text::{plain, Text};

let text = plain::Contents::from_text("Emojis!! :tada:")
    .with_emoji(true);

Trait Implementations

impl AsRef<str> for Contents[src]

impl Clone for Contents[src]

impl Debug for Contents[src]

impl Default for Contents[src]

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

impl<'_> From<&'_ str> for Contents[src]

impl From<Contents> for Compose[src]

impl From<Contents> for Text[src]

impl From<String> for Contents[src]

impl Hash for Contents[src]

impl PartialEq<Contents> for Contents[src]

impl Serialize for Contents[src]

impl StructuralPartialEq for Contents[src]

Auto Trait Implementations

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.