pub struct FeedbackButton { /* private fields */ }Expand description
Button object to be set to the positive_buttons and negative_buttons
fields of FeedbackButtons object.
§Fields and Validations
For more details, see the official documentation.
| Field | Type | Required | Validation |
|---|---|---|---|
| text | Text<Plain> | Yes | Max length 75 characters |
| value | String | Yes | Max length 2000 characters |
| accessibility_label | String | No | Max length 75 characters |
§Example
use slack_messaging::plain_text;
use slack_messaging::blocks::elements::types::FeedbackButton;
let button = FeedbackButton::builder()
.text(plain_text!("Good")?)
.value("positive_feedback")
.accessibility_label("Mark this response as good")
.build()?;
let expected = serde_json::json!({
"text": {
"type": "plain_text",
"text": "Good"
},
"value": "positive_feedback",
"accessibility_label": "Mark this response as good"
});
let json = serde_json::to_value(button).unwrap();
assert_eq!(json, expected);
// If your object has any validation errors, the build method returns Result::Err
let button = FeedbackButton::builder()
.text(plain_text!("Good")?)
.build();
assert!(button.is_err());Implementations§
Source§impl FeedbackButton
impl FeedbackButton
Sourcepub fn builder() -> FeedbackButtonBuilder
pub fn builder() -> FeedbackButtonBuilder
constract FeedbackButtonBuilder object.
Trait Implementations§
Source§impl Clone for FeedbackButton
impl Clone for FeedbackButton
Source§fn clone(&self) -> FeedbackButton
fn clone(&self) -> FeedbackButton
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FeedbackButton
impl Debug for FeedbackButton
Source§impl PartialEq for FeedbackButton
impl PartialEq for FeedbackButton
Source§fn eq(&self, other: &FeedbackButton) -> bool
fn eq(&self, other: &FeedbackButton) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for FeedbackButton
impl Serialize for FeedbackButton
impl StructuralPartialEq for FeedbackButton
Auto Trait Implementations§
impl Freeze for FeedbackButton
impl RefUnwindSafe for FeedbackButton
impl Send for FeedbackButton
impl Sync for FeedbackButton
impl Unpin for FeedbackButton
impl UnsafeUnpin for FeedbackButton
impl UnwindSafe for FeedbackButton
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