Skip to main content

SelectValue

Trait SelectValue 

Source
pub trait SelectValue: Sized {
    const MANY: bool = false;

    // Required method
    fn extract(data: &MessageComponentData) -> Result<Self, String>;
}
Expand description

A typed select handler parameter (on:select:name=|ctx, picked: Vec<Color>| ..): the selected values as String, Snowflake, resolved User, Role or PartialChannel, or a #[derive(Choice)] enum; one (required), Option or Vec.

Provided Associated Constants§

Source

const MANY: bool = false

Several selections (a Vec)

Required Methods§

Source

fn extract(data: &MessageComponentData) -> Result<Self, String>

Reads the selected values; an error message when they do not fit the type

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl SelectValue for Option<Attachment>

Source§

impl SelectValue for Option<PartialChannel>

Source§

impl SelectValue for Option<Role>

Source§

impl SelectValue for Option<Snowflake>

Source§

impl SelectValue for Option<String>

Source§

impl SelectValue for Option<User>

Source§

impl SelectValue for String

Source§

impl SelectValue for Vec<Attachment>

Source§

impl SelectValue for Vec<PartialChannel>

Source§

impl SelectValue for Vec<Role>

Source§

impl SelectValue for Vec<Snowflake>

Source§

impl SelectValue for Vec<String>

Source§

impl SelectValue for Vec<User>

Source§

impl<C: ModalChoice> SelectValue for Option<C>

Source§

impl<C: ModalChoice> SelectValue for Vec<C>

Implementors§