rydit-core 0.7.34

Core trait and registry for RyDit modules - Android game engine
Documentation
  • Coverage
  • 86.67%
    13 out of 15 items documented0 out of 11 items with examples
  • Size
  • Source code size: 11.05 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.66 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 37s Average build duration of successful builds.
  • all releases: 37s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • lapumlbb18-blip/Rydit_Engine
    3 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • lapumlbb18-blip

rydit-core

Core trait and registry for RyDit modules

Crates.io Documentation License

Overview

rydit-core provides the core trait (RyditModule) and registry system for the RyDit game engine. It allows creating modular, extensible game engine components.

Installation

[dependencies]
rydit-core = "0.7.3"

Usage

use rydit_core::{RyditModule, ModuleRegistry, ModuleResult};
use serde_json::json;

// Implement the trait for your module
struct MyModule;

impl RyditModule for MyModule {
    fn name(&self) -> &'static str { "my_module" }
    fn version(&self) -> &'static str { "1.0.0" }
    fn register(&self) -> std::collections::HashMap<&'static str, &'static str> {
        let mut cmds = std::collections::HashMap::new();
        cmds.insert("ping", "Ping command");
        cmds
    }
    fn execute(&self, command: &str, params: serde_json::Value) -> ModuleResult {
        match command {
            "ping" => Ok(json!({"status": "pong"})),
            _ => Err(rydit_core::ModuleError {
                code: "UNKNOWN".to_string(),
                message: format!("Unknown command: {}", command),
            }),
        }
    }
}

// Register and use modules
let mut registry = ModuleRegistry::new();
registry.register(Box::new(MyModule));

let result = registry.execute("my_module", "ping", json!([]));

Features

  • RyditModule trait: Define module interface
  • ModuleRegistry: Register and manage multiple modules
  • ModuleResult/ModuleError: Standardized error handling
  • Send + Sync: Thread-safe modules

License

MIT License - See LICENSE for details.

Contributing

Contributions are welcome! Please open an issue or submit a PR at: https://github.com/lapumlbb18-blip/Rydit_Engine