pub struct IconButtonElementBuilder { /* private fields */ }Expand description
Consuming builder for IconButtonElement. Validation runs in Self::build.
Implementations§
Source§impl IconButtonElementBuilder
impl IconButtonElementBuilder
Sourcepub fn text(self, value: impl Into<PlainTextInput>) -> Self
pub fn text(self, value: impl Into<PlainTextInput>) -> Self
Sets the text used as the button’s accessible name.
Sourcepub fn icon(self, value: IconButtonIcon) -> Self
pub fn icon(self, value: IconButtonIcon) -> Self
Sets the icon shown on the button.
Sourcepub fn action_id(self, value: impl Into<String>) -> Self
pub fn action_id(self, value: impl Into<String>) -> Self
Sets the identifier Slack returns in interaction payloads when a user acts on this element. It must be unique among the elements of its block.
Sourcepub fn clear_action_id(self) -> Self
pub fn clear_action_id(self) -> Self
Omits action_id, including any model default.
Sourcepub fn value(self, value: impl Into<String>) -> Self
pub fn value(self, value: impl Into<String>) -> Self
Sets the application-defined value sent in interaction payloads.
Sourcepub fn clear_value(self) -> Self
pub fn clear_value(self) -> Self
Omits value, including any model default.
Sourcepub fn confirm(self, value: impl Into<ConfirmationDialogue>) -> Self
pub fn confirm(self, value: impl Into<ConfirmationDialogue>) -> Self
Sets a confirmation dialog shown before the action is sent.
Sourcepub fn clear_confirm(self) -> Self
pub fn clear_confirm(self) -> Self
Omits confirm, including any model default.
Sourcepub fn accessibility_label(self, value: impl Into<String>) -> Self
pub fn accessibility_label(self, value: impl Into<String>) -> Self
Sets the label read by screen readers in place of the visible text.
Sourcepub fn clear_accessibility_label(self) -> Self
pub fn clear_accessibility_label(self) -> Self
Omits accessibility_label, including any model default.
Sourcepub fn visible_to_user_ids<I, T>(self, values: I) -> Self
pub fn visible_to_user_ids<I, T>(self, values: I) -> Self
Adds the IDs of users who can see this button. Replaces the collection; order is preserved.
Sourcepub fn visible_to_user_id(self, value: impl Into<String>) -> Self
pub fn visible_to_user_id(self, value: impl Into<String>) -> Self
Appends one item to the collection.
Sourcepub fn clear_visible_to_user_ids(self) -> Self
pub fn clear_visible_to_user_ids(self) -> Self
Omits visible_to_user_ids, including any model default.
Sourcepub fn extension(self, key: impl Into<String>, value: impl Into<Value>) -> Self
pub fn extension(self, key: impl Into<String>, value: impl Into<Value>) -> Self
Adds or replaces an unmodeled extension; reserved names fail at build time.
Sourcepub fn build(self) -> Result<IconButtonElement, ValidationError>
pub fn build(self) -> Result<IconButtonElement, ValidationError>
Validates all fields and their receiving context.
§Errors
Returns a ValidationError for missing fields, invalid values, reserved
extension names, or unsupported field combinations and child contexts.