pub struct CommandConfig<'a> {
pub name: &'static str,
pub description: &'static str,
pub args: Vec<ArgConfig>,
pub command_type: CommandType<'a>,
}Fields§
§name: &'static str§description: &'static str§args: Vec<ArgConfig>§command_type: CommandType<'a>Implementations§
Source§impl<'a> CommandConfig<'a>
impl<'a> CommandConfig<'a>
pub fn new_standard( name: &'static str, description: &'static str, action: Arc<dyn Fn(&[String]) + Send + Sync + 'a>, ) -> Self
pub fn new_ui( name: &'static str, description: &'static str, action: Arc<dyn Fn() -> Result<(), Error> + Send + Sync + 'a>, ) -> Self
pub fn new_ui_with_return( name: &'static str, description: &'static str, action: Arc<dyn Fn() -> Result<Option<String>, Error> + Send + Sync + 'a>, ) -> Self
pub fn add_arg(&mut self, arg: ArgConfig) -> &mut Self
pub fn execute_action(&self, args: Option<&[String]>)
Trait Implementations§
Source§impl<'a> Clone for CommandConfig<'a>
impl<'a> Clone for CommandConfig<'a>
Source§fn clone(&self) -> CommandConfig<'a>
fn clone(&self) -> CommandConfig<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'a> Freeze for CommandConfig<'a>
impl<'a> !RefUnwindSafe for CommandConfig<'a>
impl<'a> Send for CommandConfig<'a>
impl<'a> Sync for CommandConfig<'a>
impl<'a> Unpin for CommandConfig<'a>
impl<'a> !UnwindSafe for CommandConfig<'a>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more