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