pub struct DatetimePicker { /* private fields */ }Expand description
Datetime picker element representation.
§Fields and Validations
For more details, see the official documentation.
| Field | Type | Required | Validation |
|---|---|---|---|
| action_id | String | No | Max length 255 characters |
| initial_date_time | i64 | No | Must match 10 digits format |
| confirm | ConfirmationDialog | No | N/A |
| focus_on_load | bool | No | N/A |
§Example
use slack_messaging::blocks::elements::DatetimePicker;
let datetimepicker = DatetimePicker::builder()
.action_id("datetime_input")
.initial_date_time(1628633820)
.build()?;
let expected = serde_json::json!({
"type": "datetimepicker",
"action_id": "datetime_input",
"initial_date_time": 1628633820
});
let json = serde_json::to_value(datetimepicker).unwrap();
assert_eq!(json, expected);
// If your object has any validation errors, the build method returns Result::Err
let datetimepicker = DatetimePicker::builder()
.action_id("datetime_input")
.initial_date_time(1000)
.build();
assert!(datetimepicker.is_err());Implementations§
Source§impl DatetimePicker
impl DatetimePicker
Sourcepub fn builder() -> DatetimePickerBuilder
pub fn builder() -> DatetimePickerBuilder
constract DatetimePickerBuilder object.
Trait Implementations§
Source§impl Clone for DatetimePicker
impl Clone for DatetimePicker
Source§fn clone(&self) -> DatetimePicker
fn clone(&self) -> DatetimePicker
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 DatetimePicker
impl Debug for DatetimePicker
Source§impl From<DatetimePicker> for ActionsElement
impl From<DatetimePicker> for ActionsElement
Source§fn from(value: DatetimePicker) -> Self
fn from(value: DatetimePicker) -> Self
Converts to this type from the input type.
Source§impl From<DatetimePicker> for InputElement
impl From<DatetimePicker> for InputElement
Source§fn from(value: DatetimePicker) -> Self
fn from(value: DatetimePicker) -> Self
Converts to this type from the input type.
Source§impl PartialEq for DatetimePicker
impl PartialEq for DatetimePicker
Source§impl Serialize for DatetimePicker
impl Serialize for DatetimePicker
impl StructuralPartialEq for DatetimePicker
Auto Trait Implementations§
impl Freeze for DatetimePicker
impl RefUnwindSafe for DatetimePicker
impl Send for DatetimePicker
impl Sync for DatetimePicker
impl Unpin for DatetimePicker
impl UnwindSafe for DatetimePicker
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)