pub struct Command<'a, S, E> {
pub name: String,
pub aliases: Vec<String>,
pub description: String,
pub input_hint: Option<String>,
pub meta: Map<String, Value>,
/* private fields */
}Fields§
§name: String§aliases: Vec<String>§description: String§input_hint: Option<String>§meta: Map<String, Value>Implementations§
Source§impl<'a, S, E> Command<'a, S, E>
impl<'a, S, E> Command<'a, S, E>
pub fn new( name: impl Into<String>, description: impl Into<String>, action: impl for<'c> Fn(CommandCall<'c, 'a, S>) -> OperationFuture<'c, Result<OperationResult<E>>> + MaybeSend + MaybeSync + 'a, ) -> Self
pub fn answers_to(&self, name: &str) -> bool
pub async fn run( &self, arguments: &str, session: &S, conversation: &Conversation, emit: &Emitter, ) -> Result<OperationResult<E>>
Auto Trait Implementations§
impl<'a, S, E> !RefUnwindSafe for Command<'a, S, E>
impl<'a, S, E> !UnwindSafe for Command<'a, S, E>
impl<'a, S, E> Forget for Command<'a, S, E>
impl<'a, S, E> Freeze for Command<'a, S, E>
impl<'a, S, E> Move for Command<'a, S, E>
impl<'a, S, E> Send for Command<'a, S, E>
impl<'a, S, E> Sync for Command<'a, S, E>
impl<'a, S, E> Unpin for Command<'a, S, E>
impl<'a, S, E> UnsafeUnpin for Command<'a, S, E>where
Box<dyn for<'c> Fn(CommandCall<'c, 'a, S>) -> Pin<Box<dyn Future<Output = Result<OperationResult<E>, Error>> + Send + 'c>> + Send + Sync + 'a>: UnsafeUnpin,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoMaybeUndefined<T> for T
impl<T> IntoMaybeUndefined<T> for T
Source§fn into_maybe_undefined(self) -> MaybeUndefined<T>
fn into_maybe_undefined(self) -> MaybeUndefined<T>
Converts this value into a three-state builder argument.
Source§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
Source§fn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Converts this value into an optional builder argument.