pub struct FileInput { /* private fields */ }Expand description
File 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 |
| filetypes | Vec<FileType> | No | N/A |
| max_files | i64 | No | Min value 1, Max value 10 |
§Example
use slack_messaging::blocks::elements::{FileInput, types::FileType};
let input = FileInput::builder()
.action_id("file_input_action_id_1")
.filetype(FileType::Jpg)
.build()?;
let expected = serde_json::json!({
"type": "file_input",
"action_id": "file_input_action_id_1",
"filetypes": ["jpg"]
});
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 = FileInput::builder()
.action_id("file_input_action_id_1")
.filetype(FileType::Jpg)
.max_files(99)
.build();
assert!(input.is_err());Implementations§
Source§impl FileInput
impl FileInput
Sourcepub fn builder() -> FileInputBuilder
pub fn builder() -> FileInputBuilder
constract FileInputBuilder object.
Trait Implementations§
Source§impl From<FileInput> for InputElement
impl From<FileInput> for InputElement
impl StructuralPartialEq for FileInput
Auto Trait Implementations§
impl Freeze for FileInput
impl RefUnwindSafe for FileInput
impl Send for FileInput
impl Sync for FileInput
impl Unpin for FileInput
impl UnwindSafe for FileInput
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)