pub struct EmailInput { /* private fields */ }Expand description
Email input 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_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::plain_text;
use slack_messaging::blocks::elements::EmailInput;
let input = EmailInput::builder()
.action_id("input_email")
.placeholder(plain_text!("Enter an email")?)
.build()?;
let expected = serde_json::json!({
"type": "email_text_input",
"action_id": "input_email",
"placeholder": {
"type": "plain_text",
"text": "Enter an email"
}
});
let json = serde_json::to_value(input).unwrap();
assert_eq!(json, expected);
// If your object has any validation errors, the build method returns Result::Err
let input = EmailInput::builder()
.action_id("input_email")
.placeholder(plain_text!("{}", "verrrrrrry long text".repeat(10))?)
.build();
assert!(input.is_err());Implementations§
Source§impl EmailInput
impl EmailInput
Sourcepub fn builder() -> EmailInputBuilder
pub fn builder() -> EmailInputBuilder
constract EmailInputBuilder object.
Trait Implementations§
Source§impl Clone for EmailInput
impl Clone for EmailInput
Source§fn clone(&self) -> EmailInput
fn clone(&self) -> EmailInput
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 EmailInput
impl Debug for EmailInput
Source§impl From<EmailInput> for InputElement
impl From<EmailInput> for InputElement
Source§fn from(value: EmailInput) -> Self
fn from(value: EmailInput) -> Self
Converts to this type from the input type.
Source§impl PartialEq for EmailInput
impl PartialEq for EmailInput
Source§impl Serialize for EmailInput
impl Serialize for EmailInput
impl StructuralPartialEq for EmailInput
Auto Trait Implementations§
impl Freeze for EmailInput
impl RefUnwindSafe for EmailInput
impl Send for EmailInput
impl Sync for EmailInput
impl Unpin for EmailInput
impl UnwindSafe for EmailInput
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)