pub struct Argument<S> {
pub name: String,
/* private fields */
}
Expand description
An argument node type. The T
type parameter is the type of the argument,
which can be anything.
Fields§
§name: String
Implementations§
Source§impl<S> Argument<S>
impl<S> Argument<S>
pub fn new( name: &str, parser: Arc<dyn ArgumentType + Send + Sync>, custom_suggestions: Option<Arc<dyn SuggestionProvider<S> + Send + Sync>>, ) -> Self
pub fn parse( &self, reader: &mut StringReader, ) -> Result<Arc<dyn Any>, CommandSyntaxError>
pub fn list_suggestions( &self, context: CommandContext<S>, builder: SuggestionsBuilder, ) -> Suggestions
pub fn examples(&self) -> Vec<String>
Trait Implementations§
Auto Trait Implementations§
impl<S> Freeze for Argument<S>
impl<S> !RefUnwindSafe for Argument<S>
impl<S> Send for Argument<S>
impl<S> Sync for Argument<S>
impl<S> Unpin for Argument<S>
impl<S> !UnwindSafe for Argument<S>
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