pub struct PlainText { /* private fields */ }Expand description
Plain text object representation.
There is a Text object like this.
The difference between these two objects is that Text
can be used incase of both of plain text and mrkdwn are allowed to used.
On the other hand, use PlainText instead of Text incase of only PlainText
is allowed to use.
§example to use Text
- The
textanddescriptionfield ofOptobject in theCheckboxesandRadioButtonGroupelement - The
textfield ofSectionblock
§example to use PlainText
- The
textfield ofButtonelement.
let text = PlainText::builder()
.text("Hello, World!")
.build();
let json = serde_json::to_value(text).unwrap();
let expected = serde_json::json!({
"type": "plain_text",
"text": "Hello, World!"
});
assert_eq!(json, expected);Implementations§
Source§impl PlainText
impl PlainText
Sourcepub fn builder() -> PlainTextBuilder
pub fn builder() -> PlainTextBuilder
Construct a PlainTextBuilder.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PlainText
impl RefUnwindSafe for PlainText
impl Send for PlainText
impl Sync for PlainText
impl Unpin for PlainText
impl UnwindSafe for PlainText
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