pub struct UrlInput { /* private fields */ }Expand description
URL 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::UrlInput;
let input = UrlInput::builder()
.action_id("url_input_action")
.placeholder(plain_text!("Enter url")?)
.build()?;
let expected = serde_json::json!({
"type": "url_text_input",
"action_id": "url_input_action",
"placeholder": {
"type": "plain_text",
"text": "Enter url"
}
});
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 = UrlInput::builder()
.action_id("url_input_action")
.placeholder(plain_text!("{}", "verrrrry long text".repeat(100))?)
.build();
assert!(input.is_err());Implementations§
Source§impl UrlInput
impl UrlInput
Sourcepub fn builder() -> UrlInputBuilder
pub fn builder() -> UrlInputBuilder
constract UrlInputBuilder object.
Trait Implementations§
Source§impl From<UrlInput> for InputElement
impl From<UrlInput> for InputElement
impl StructuralPartialEq for UrlInput
Auto Trait Implementations§
impl Freeze for UrlInput
impl RefUnwindSafe for UrlInput
impl Send for UrlInput
impl Sync for UrlInput
impl Unpin for UrlInput
impl UnwindSafe for UrlInput
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)