pub struct SelectMenuUsers { /* private fields */ }Expand description
Select menu of users representation
§Fields and Validations
For more details, see the official documentation.
| Field | Type | Required | Validation |
|---|---|---|---|
| action_id | String | No | Max length 255 characters |
| initial_user | String | No | N/A |
| confirm | ConfirmationDialog | 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::SelectMenuUsers;
let menu = SelectMenuUsers::builder()
.action_id("text1234")
.placeholder(plain_text!("Select an item")?)
.build()?;
let expected = serde_json::json!({
"type": "users_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 = SelectMenuUsers::builder()
.action_id("text1234")
.placeholder(plain_text!("{}", "verrrrry long text".repeat(100))?)
.build();
assert!(menu.is_err());Implementations§
Source§impl SelectMenuUsers
impl SelectMenuUsers
Sourcepub fn builder() -> SelectMenuUsersBuilder
pub fn builder() -> SelectMenuUsersBuilder
constract SelectMenuUsersBuilder object.
Trait Implementations§
Source§impl Clone for SelectMenuUsers
impl Clone for SelectMenuUsers
Source§fn clone(&self) -> SelectMenuUsers
fn clone(&self) -> SelectMenuUsers
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 SelectMenuUsers
impl Debug for SelectMenuUsers
Source§impl Default for SelectMenuUsers
impl Default for SelectMenuUsers
Source§fn default() -> SelectMenuUsers
fn default() -> SelectMenuUsers
Returns the “default value” for a type. Read more
Source§impl From<SelectMenuUsers> for Accessory
impl From<SelectMenuUsers> for Accessory
Source§fn from(value: SelectMenuUsers) -> Self
fn from(value: SelectMenuUsers) -> Self
Converts to this type from the input type.
Source§impl From<SelectMenuUsers> for ActionsElement
impl From<SelectMenuUsers> for ActionsElement
Source§fn from(value: SelectMenuUsers) -> Self
fn from(value: SelectMenuUsers) -> Self
Converts to this type from the input type.
Source§impl From<SelectMenuUsers> for InputElement
impl From<SelectMenuUsers> for InputElement
Source§fn from(value: SelectMenuUsers) -> Self
fn from(value: SelectMenuUsers) -> Self
Converts to this type from the input type.
Source§impl PartialEq for SelectMenuUsers
impl PartialEq for SelectMenuUsers
Source§impl Serialize for SelectMenuUsers
impl Serialize for SelectMenuUsers
impl StructuralPartialEq for SelectMenuUsers
Auto Trait Implementations§
impl Freeze for SelectMenuUsers
impl RefUnwindSafe for SelectMenuUsers
impl Send for SelectMenuUsers
impl Sync for SelectMenuUsers
impl Unpin for SelectMenuUsers
impl UnwindSafe for SelectMenuUsers
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)