Skip to content

Files

Latest commit

e21e1b9 · Feb 23, 2025

History

History

azalea-brigadier

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Feb 23, 2025
Feb 22, 2025
Feb 2, 2025
Oct 8, 2023

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.