Struct slack_blocks::elems::TextInput [−][src]
pub struct TextInput<'a> { /* fields omitted */ }
Expand description
Plain Text Input
A plain-text input, similar to the HTML <input>
tag, creates a field where a user can enter freeform data.
It can appear as a single-line field or a larger textarea using the multiline
flag.
Works in [blocks 🔗]: Input Works in [app surfaces 🔗]: Home tabs, Modals, Messages
Implementations
impl<'a> TextInput<'a>
[src]
impl<'a> TextInput<'a>
[src]pub fn builder() -> TextInputBuilderInit<'a>
[src]
pub fn builder() -> TextInputBuilderInit<'a>
[src]pub fn validate(&self) -> Result<(), ValidationErrors>
[src]
pub fn validate(&self) -> Result<(), ValidationErrors>
[src]Validate that this select element agrees with Slack’s model requirements
Errors
- length of
placeholder
greater than 150 - length of
action_id
greater than 255 - value of
min_length
greater than 3000
Example
use slack_blocks::elems::TextInput; let long_string = || std::iter::repeat('a').take(256).collect::<String>(); let input = TextInput::builder().action_id(long_string()) .placeholder(long_string()) .min_length(3001) .build(); assert!(matches!(input.validate(), Err(_)))
Trait Implementations
impl<'de, 'a> Deserialize<'de> for TextInput<'a>
[src]
impl<'de, 'a> Deserialize<'de> for TextInput<'a>
[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
impl<'a> From<TextInput<'a>> for SupportedElement<'a>
[src]
impl<'a> From<TextInput<'a>> for SupportedElement<'a>
[src]impl<'a> From<TextInput<'a>> for SupportedElement<'a>
[src]
impl<'a> From<TextInput<'a>> for SupportedElement<'a>
[src]impl<'a> From<TextInput<'a>> for BlockElement<'a>
[src]
impl<'a> From<TextInput<'a>> for BlockElement<'a>
[src]impl<'a> StructuralPartialEq for TextInput<'a>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for TextInput<'a>
impl<'a> Send for TextInput<'a>
impl<'a> Sync for TextInput<'a>
impl<'a> Unpin for TextInput<'a>
impl<'a> UnwindSafe for TextInput<'a>
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,