pub struct NumberInput { /* private fields */ }Expand description
Number input element representation.
§Fields and Validations
For more details, see the official documentation.
| Field | Type | Required | Validation |
|---|---|---|---|
| is_decimal_allowed | bool | Yes | N/A |
| action_id | String | No | Max length 255 characters |
| initial_value | String | No | N/A |
| min_value | String | No | N/A |
| max_value | String | No | N/A |
| dispatch_action_config | DispatchActionConfiguration | No | N/A |
| focus_on_load | bool | No | N/A |
| placeholder | Text<Plain> | No | Max length 150 characters |
§Example
use slack_messaging::blocks::elements::NumberInput;
let num = NumberInput::builder()
.action_id("input_number")
.is_decimal_allowed(true)
.build()?;
let expected = serde_json::json!({
"type": "number_input",
"action_id": "input_number",
"is_decimal_allowed": true
});
let json = serde_json::to_value(num).unwrap();
assert_eq!(json, expected);
// If your object has any validation errors, the build method returns Result::Err
let num = NumberInput::builder()
.action_id("input_number")
.build();
assert!(num.is_err());Implementations§
Source§impl NumberInput
impl NumberInput
Sourcepub fn builder() -> NumberInputBuilder
pub fn builder() -> NumberInputBuilder
constract NumberInputBuilder object.
Trait Implementations§
Source§impl Clone for NumberInput
impl Clone for NumberInput
Source§fn clone(&self) -> NumberInput
fn clone(&self) -> NumberInput
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 NumberInput
impl Debug for NumberInput
Source§impl From<NumberInput> for InputElement
impl From<NumberInput> for InputElement
Source§fn from(value: NumberInput) -> Self
fn from(value: NumberInput) -> Self
Converts to this type from the input type.
Source§impl PartialEq for NumberInput
impl PartialEq for NumberInput
Source§impl Serialize for NumberInput
impl Serialize for NumberInput
impl StructuralPartialEq for NumberInput
Auto Trait Implementations§
impl Freeze for NumberInput
impl RefUnwindSafe for NumberInput
impl Send for NumberInput
impl Sync for NumberInput
impl Unpin for NumberInput
impl UnwindSafe for NumberInput
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)