12 releases (breaking)

0.10.2 Jun 14, 2024
0.9.1 Apr 19, 2024
0.9.0 Dec 5, 2023
0.8.0 Sep 15, 2023
0.4.0 Nov 19, 2022

#1 in #dispatching

Download history 26/week @ 2024-03-28 16/week @ 2024-04-04 280/week @ 2024-04-18 69/week @ 2024-04-25 9/week @ 2024-05-02 9/week @ 2024-05-16 15/week @ 2024-05-23 6/week @ 2024-05-30 11/week @ 2024-06-06 191/week @ 2024-06-13 6/week @ 2024-06-20 8/week @ 2024-06-27 60/week @ 2024-07-04 6/week @ 2024-07-11

81 downloads per month
Used in 4 crates (2 directly)

MIT license

115KB
3K SLoC

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.

Dependencies

~0.4–6.5MB
~20K SLoC