Skip to main content

InputBlockBuilder

Struct InputBlockBuilder 

Source
pub struct InputBlockBuilder { /* private fields */ }
Expand description

Consuming builder for InputBlock. Validation runs in Self::build.

Implementations§

Source§

impl InputBlockBuilder

Source

pub fn label(self, value: impl Into<PlainTextInput>) -> Self

Sets the label shown above the input.

Source

pub fn element(self, value: impl Into<InputElement>) -> Self

Sets the input element that collects the user’s value.

Source

pub fn dispatch_action(self, value: bool) -> Self

Sets whether changing the element sends a block_actions payload immediately.

Source

pub fn clear_dispatch_action(self) -> Self

Omits dispatch_action, including any model default.

Source

pub fn block_id(self, value: impl Into<String>) -> Self

Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.

Source

pub fn clear_block_id(self) -> Self

Omits block_id, including any model default.

Source

pub fn hint(self, value: impl Into<PlainTextInput>) -> Self

Sets helper text shown below the input.

Source

pub fn clear_hint(self) -> Self

Omits hint, including any model default.

Source

pub fn optional(self, value: bool) -> Self

Sets whether the modal can be submitted when this input is empty.

Source

pub fn clear_optional(self) -> Self

Omits optional, including any model default.

Source

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.

Source

pub fn build(self) -> Result<InputBlock, 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.

Trait Implementations§

Source§

impl Clone for InputBlockBuilder

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for InputBlockBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for InputBlockBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.