Struct slack_blocks::text::build::TextBuilder [−][src]
pub struct TextBuilder<T, TMarker> { /* fields omitted */ }Expand description
Text Builder
Allows you to construct safely, with compile-time checks on required setter methods.
Required Methods
TextBuilder::build() is only available if these methods have been called:
textplainormrkdwn
use slack_blocks::text::Text; let foo = Text::builder().plain().text("foo").build();
Implementations
impl<T> TextBuilder<T, RequiredMethodNotCalled<text>>[src]
impl<T> TextBuilder<T, RequiredMethodNotCalled<text>>[src]pub fn text(self, t: impl AsRef<str>) -> TextBuilder<T, Set<text>>[src]
pub fn text(self, t: impl AsRef<str>) -> TextBuilder<T, Set<text>>[src]Set text (Required)
The text contents to render for this Text object.
For some basic formatting examples, see the docs for
the text::Mrkdwn, 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.
impl<M> TextBuilder<Text, M>[src]
impl<M> TextBuilder<Text, M>[src]pub fn plain(self) -> TextBuilder<Plain, M>[src]
pub fn plain(self) -> TextBuilder<Plain, M>[src]Set the text you’re building to be plain_text (Required)
pub fn mrkdwn(self) -> TextBuilder<Mrkdwn, M>[src]
pub fn mrkdwn(self) -> TextBuilder<Mrkdwn, M>[src]Set the text you’re building to be mrkdwn (Required)
impl<M> TextBuilder<Mrkdwn, M>[src]
impl<M> TextBuilder<Mrkdwn, M>[src]pub fn verbatim(self) -> Self[src]
pub fn verbatim(self) -> Self[src]Set verbatim (Optional)
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.
impl<M> TextBuilder<Plain, M>[src]
impl<M> TextBuilder<Plain, M>[src]impl<T: Into<Text>> TextBuilder<T, Set<text>>[src]
impl<T: Into<Text>> TextBuilder<T, Set<text>>[src]pub fn build(self) -> Text[src]
pub fn build(self) -> Text[src]All done building, now give me a darn text object!
no method name 'build' found for struct 'TextBuilder<...>'? Make sure all required setter methods have been called. See docs forTextBuilder.
use slack_blocks::text::Text; let foo = Text::builder().build(); // Won't compile!
use slack_blocks::text::Text; let foo = Text::builder().plain().emoji().text("foo :joy:").build();
Trait Implementations
Auto Trait Implementations
impl<T, TMarker> RefUnwindSafe for TextBuilder<T, TMarker> where
T: RefUnwindSafe,
TMarker: RefUnwindSafe,
T: RefUnwindSafe,
TMarker: RefUnwindSafe,
impl<T, TMarker> Send for TextBuilder<T, TMarker> where
T: Send,
TMarker: Send,
T: Send,
TMarker: Send,
impl<T, TMarker> Sync for TextBuilder<T, TMarker> where
T: Sync,
TMarker: Sync,
T: Sync,
TMarker: Sync,
impl<T, TMarker> Unpin for TextBuilder<T, TMarker> where
T: Unpin,
TMarker: Unpin,
T: Unpin,
TMarker: Unpin,
impl<T, TMarker> UnwindSafe for TextBuilder<T, TMarker> where
T: UnwindSafe,
TMarker: UnwindSafe,
T: UnwindSafe,
TMarker: UnwindSafe,