pub struct SelectMenuConversations { /* private fields */ }Expand description
Select menu of conversations representation
§Fields and Validations
For more details, see the official documentation.
| Field | Type | Required | Validation |
|---|---|---|---|
| action_id | String | No | Max length 255 characters |
| initial_conversation | String | No | N/A |
| default_to_current_conversation | bool | No | N/A |
| confirm | ConfirmationDialog | No | N/A |
| response_url_enabled | bool | No | N/A |
| filter | ConversationFilter | No | N/A |
| focus_on_load | bool | No | N/A |
| placeholder | Text<Plain> | No | Max length 150 characters |
§Example
use slack_messaging::plain_text;
use slack_messaging::blocks::elements::SelectMenuConversations;
let menu = SelectMenuConversations::builder()
.action_id("text1234")
.placeholder(plain_text!("Select an item")?)
.build()?;
let expected = serde_json::json!({
"type": "conversations_select",
"action_id": "text1234",
"placeholder": {
"type": "plain_text",
"text": "Select an item"
}
});
let json = serde_json::to_value(menu).unwrap();
assert_eq!(json, expected);
// If your object has any validation errors, the build method returns Result::Err
let menu = SelectMenuConversations::builder()
.action_id("text1234")
.placeholder(plain_text!("{}", "verrrrry long text".repeat(100))?)
.build();
assert!(menu.is_err());Implementations§
Source§impl SelectMenuConversations
impl SelectMenuConversations
Sourcepub fn builder() -> SelectMenuConversationsBuilder
pub fn builder() -> SelectMenuConversationsBuilder
constract SelectMenuConversationsBuilder object.
Trait Implementations§
Source§impl Clone for SelectMenuConversations
impl Clone for SelectMenuConversations
Source§fn clone(&self) -> SelectMenuConversations
fn clone(&self) -> SelectMenuConversations
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SelectMenuConversations
impl Debug for SelectMenuConversations
Source§impl Default for SelectMenuConversations
impl Default for SelectMenuConversations
Source§fn default() -> SelectMenuConversations
fn default() -> SelectMenuConversations
Returns the “default value” for a type. Read more
Source§impl From<SelectMenuConversations> for Accessory
impl From<SelectMenuConversations> for Accessory
Source§fn from(value: SelectMenuConversations) -> Self
fn from(value: SelectMenuConversations) -> Self
Converts to this type from the input type.
Source§impl From<SelectMenuConversations> for ActionsElement
impl From<SelectMenuConversations> for ActionsElement
Source§fn from(value: SelectMenuConversations) -> Self
fn from(value: SelectMenuConversations) -> Self
Converts to this type from the input type.
Source§impl From<SelectMenuConversations> for InputElement
impl From<SelectMenuConversations> for InputElement
Source§fn from(value: SelectMenuConversations) -> Self
fn from(value: SelectMenuConversations) -> Self
Converts to this type from the input type.
Source§impl PartialEq for SelectMenuConversations
impl PartialEq for SelectMenuConversations
Source§impl Serialize for SelectMenuConversations
impl Serialize for SelectMenuConversations
impl StructuralPartialEq for SelectMenuConversations
Auto Trait Implementations§
impl Freeze for SelectMenuConversations
impl RefUnwindSafe for SelectMenuConversations
impl Send for SelectMenuConversations
impl Sync for SelectMenuConversations
impl Unpin for SelectMenuConversations
impl UnwindSafe for SelectMenuConversations
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)