pub struct OptGroup<'a, T = AnyText, U = NoUrl> { /* private fields */ }Expand description
§Option Group
Provides a way to group options in a select menu 🔗 or multi-select menu 🔗.
Implementations§
Source§impl<'a, T, U> OptGroup<'a, T, U>
impl<'a, T, U> OptGroup<'a, T, U>
Sourcepub fn validate(&self) -> Result<(), ValidationErrors>
Available on crate feature validation only.
pub fn validate(&self) -> Result<(), ValidationErrors>
validation only.Validate that this Option Group object agrees with Slack’s model requirements
§Errors
- If
labellonger than 75 chars - If
optscontains more than 100 options
§Example
use std::iter::repeat;
use slack_blocks::compose::{Opt, OptGroup};
let long_string: String = repeat(' ').take(76).collect();
let opt = Opt::builder().text_plain("San Diego")
.value("ca_sd")
.build();
let grp = OptGroup::builder().label(long_string).option(opt).build();
assert_eq!(true, matches!(grp.validate(), Err(_)));Trait Implementations§
Source§impl<'a, Multi, Placeholder, ActionId> AppendOptOrOptGroup<'a, Multi, Placeholder, ActionId> for OptGroup<'a, Plain, NoUrl>
Available on crate feature blox only.
impl<'a, Multi, Placeholder, ActionId> AppendOptOrOptGroup<'a, Multi, Placeholder, ActionId> for OptGroup<'a, Plain, NoUrl>
Available on crate feature
blox only.Source§impl<'de, 'a, T, U> Deserialize<'de> for OptGroup<'a, T, U>where
T: Deserialize<'de>,
U: Deserialize<'de>,
impl<'de, 'a, T, U> Deserialize<'de> for OptGroup<'a, T, U>where
T: Deserialize<'de>,
U: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'a, T, U> From<OptGroup<'a, T, U>> for OptOrOptGroup<'a, T, U>
impl<'a, T, U> From<OptGroup<'a, T, U>> for OptOrOptGroup<'a, T, U>
impl<'a, T, U> StructuralPartialEq for OptGroup<'a, T, U>
Auto Trait Implementations§
impl<'a, T, U> Freeze for OptGroup<'a, T, U>
impl<'a, T, U> RefUnwindSafe for OptGroup<'a, T, U>where
T: RefUnwindSafe,
U: RefUnwindSafe,
impl<'a, T, U> Send for OptGroup<'a, T, U>
impl<'a, T, U> Sync for OptGroup<'a, T, U>
impl<'a, T, U> Unpin for OptGroup<'a, T, U>
impl<'a, T, U> UnwindSafe for OptGroup<'a, T, U>where
T: UnwindSafe,
U: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more