Skip to main content

AsCommandArgumentValue

Trait AsCommandArgumentValue 

Source
pub trait AsCommandArgumentValue {
    // Required methods
    fn value_type() -> CommandArgumentValueType;
    fn from_returned_argument<'life0, 'async_trait>(
        ctx: &'life0 Context,
        arg: Option<CommandArgumentValue>,
    ) -> Pin<Box<dyn Future<Output = Result<Self, ArgumentError>> + Send + 'async_trait>>
       where Self: Sized + 'async_trait,
             'life0: 'async_trait;
}
Expand description

Represents a value that can be passed to a command, like a string, integer, or file Note: This is not made for wrappers like Vec or Option as they should use AsCommandArgument

Required Methods§

Source

fn value_type() -> CommandArgumentValueType

Source

fn from_returned_argument<'life0, 'async_trait>( ctx: &'life0 Context, arg: Option<CommandArgumentValue>, ) -> Pin<Box<dyn Future<Output = Result<Self, ArgumentError>> + Send + 'async_trait>>
where Self: Sized + 'async_trait, 'life0: 'async_trait,

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 AsCommandArgumentValue for Channel

Source§

fn value_type() -> CommandArgumentValueType

Source§

fn from_returned_argument<'life0, 'async_trait>( ctx: &'life0 Context, arg: Option<CommandArgumentValue>, ) -> Pin<Box<dyn Future<Output = Result<Self, ArgumentError>> + Send + 'async_trait>>
where Self: Sized + 'async_trait, 'life0: 'async_trait,

Source§

impl AsCommandArgumentValue for ChannelId

Source§

fn value_type() -> CommandArgumentValueType

Source§

fn from_returned_argument<'life0, 'async_trait>( _ctx: &'life0 Context, arg: Option<CommandArgumentValue>, ) -> Pin<Box<dyn Future<Output = Result<Self, ArgumentError>> + Send + 'async_trait>>
where Self: Sized + 'async_trait, 'life0: 'async_trait,

Source§

impl AsCommandArgumentValue for GuildChannel

Source§

fn value_type() -> CommandArgumentValueType

Source§

fn from_returned_argument<'life0, 'async_trait>( ctx: &'life0 Context, arg: Option<CommandArgumentValue>, ) -> Pin<Box<dyn Future<Output = Result<Self, ArgumentError>> + Send + 'async_trait>>
where Self: Sized + 'async_trait, 'life0: 'async_trait,

Source§

impl AsCommandArgumentValue for RoleId

Source§

fn value_type() -> CommandArgumentValueType

Source§

fn from_returned_argument<'life0, 'async_trait>( _ctx: &'life0 Context, arg: Option<CommandArgumentValue>, ) -> Pin<Box<dyn Future<Output = Result<Self, ArgumentError>> + Send + 'async_trait>>
where Self: Sized + 'async_trait, 'life0: 'async_trait,

Source§

impl AsCommandArgumentValue for String

Source§

fn value_type() -> CommandArgumentValueType

Source§

fn from_returned_argument<'life0, 'async_trait>( _ctx: &'life0 Context, arg: Option<CommandArgumentValue>, ) -> Pin<Box<dyn Future<Output = Result<Self, ArgumentError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

impl AsCommandArgumentValue for User

Source§

fn value_type() -> CommandArgumentValueType

Source§

fn from_returned_argument<'life0, 'async_trait>( ctx: &'life0 Context, arg: Option<CommandArgumentValue>, ) -> Pin<Box<dyn Future<Output = Result<Self, ArgumentError>> + Send + 'async_trait>>
where Self: Sized + 'async_trait, 'life0: 'async_trait,

Source§

impl AsCommandArgumentValue for UserId

Source§

fn value_type() -> CommandArgumentValueType

Source§

fn from_returned_argument<'life0, 'async_trait>( _ctx: &'life0 Context, arg: Option<CommandArgumentValue>, ) -> Pin<Box<dyn Future<Output = Result<Self, ArgumentError>> + Send + 'async_trait>>
where Self: Sized + 'async_trait, 'life0: 'async_trait,

Source§

impl AsCommandArgumentValue for bool

Source§

fn value_type() -> CommandArgumentValueType

Source§

fn from_returned_argument<'life0, 'async_trait>( _ctx: &'life0 Context, arg: Option<CommandArgumentValue>, ) -> Pin<Box<dyn Future<Output = Result<Self, ArgumentError>> + Send + 'async_trait>>
where Self: Sized + 'async_trait, 'life0: 'async_trait,

Implementors§

Source§

impl<T: Number> AsCommandArgumentValue for T