mirror of
https://github.com/mat-1/azalea.git
synced 2024-09-18 22:32:31 +00:00
38eab50b4f
azalea-block@0.10.2 azalea-block-macros@0.10.2 azalea-brigadier@0.10.2 azalea-buf@0.10.2 azalea-chat@0.10.2 azalea-client@0.10.2 azalea-core@0.10.2 azalea-entity@0.10.2 azalea-inventory@0.10.2 azalea-physics@0.10.2 azalea-protocol@0.10.2 azalea-registry@0.10.2 azalea-world@0.10.2 Generated by cargo-workspaces |
||
---|---|---|
.. | ||
src | ||
tests | ||
Cargo.toml | ||
README.md |
Azalea Brigadier
A Rust port of Mojang's Brigadier command parsing and dispatching library.
Examples
use azalea_brigadier::prelude::*;
use std::sync::Arc;
#[derive(Debug, PartialEq)]
struct CommandSource {}
let mut subject = CommandDispatcher::new();
subject.register(literal("foo").executes(|_| 42));
assert_eq!(
subject
.execute("foo", Arc::new(CommandSource {}))
.unwrap(),
42
);
See the tests for more.