command_core 0.1.1

A no_std flexible function interpreter using phf for compile-time command dispatch.
Documentation
# command_core


A minimal, `#![no_std]`-friendly **function interpreter** for mapping string commands to Rust functions using [`phf`](https://docs.rs/phf).  
Designed for embedded systems, game engines, scripting layers, or any environment where you want **fast, compile-time command dispatch** without heap allocations.

---

## Features


- **`#![no_std]` compatible** — works in embedded and constrained environments.
- **Zero runtime hashing** — powered by [`phf`]https://docs.rs/phf for perfect hash maps at compile time.
- **Immutable interpreter reference** — allows recursive commands or conditional logic.
- **Type-safe command functions** — no dynamic typing or unsafe casting.

---

## Example

``` rust
use command_core::{phf::phf_map, CommandFn, FI};

// Example state struct
struct MyStruct {}

// Example command function
fn print_cmd(_interpreter: &FI<MyStruct>, _state: &mut MyStruct, args: &[&str]) {
    for arg in args {
        println!("I have printed {}", arg);
    }
}

// Compile-time command map
static FUNCTION_MAP: phf::Map<&'static str, CommandFn<MyStruct>> = phf_map! {
    "print" => print_cmd,
};

fn main() {
    let interpreter = FI::new(&FUNCTION_MAP);
    let mut state = MyStruct {};

    // Execute: print 37 47 57 67
    interpreter.interpret(&["print", "37", "47", "57", "67"], &mut state);
}