1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 06:16:04 +00:00

add argument type trait

This commit is contained in:
mat 2022-01-03 22:53:53 -06:00
parent bd87cbb443
commit e3ecb607b8

View file

@ -0,0 +1,20 @@
pub trait ArgumentType<T> {
// T parse(StringReader reader) throws CommandSyntaxException;
// default <S> CompletableFuture<Suggestions> listSuggestions(final CommandContext<S> context, final SuggestionsBuilder builder) {
// return Suggestions.empty();
// }
// default Collection<String> getExamples() {
// return Collections.emptyList();
// }
fn parse(reader: &mut StringReader) -> Result<T, CommandSyntaxError>;
fn list_suggestions<S>(
context: &CommandContext<S>,
builder: &mut SuggestionsBuilder,
) -> Result<Suggestions, CommandSyntaxError>;
fn get_examples() -> Vec<String>;
}