Expand description
§JetCrab API Module
Provides the public API for the JetCrab JavaScript engine, including high-level interfaces for code execution, compilation, debugging, and module management.
§Overview
The API module exposes the following main components:
- Engine: Main execution engine for JavaScript code
- Interpreter: Bytecode interpreter with execution context
- Compiler: Source code to bytecode compilation
- Debug: Debugging and profiling tools
- Events: Event system for execution monitoring
- Modules: Module loading and management system
- Config: Engine configuration and settings
- Error: API error handling and types
§Usage
use jetcrab::api::{Engine, Interpreter, Compiler};
// Create and use the main engine
let mut engine = Engine::new();
let result = engine.evaluate("2 + 2")?;
// Use the interpreter directly
let interpreter = Interpreter::new(vec![], vec![]);
let result = interpreter.execute()?;Re-exports§
pub use compiler::Compiler;pub use config::EngineConfig;pub use config::MemoryConfig;pub use config::ModuleSystem;pub use config::OptimizationLevel;pub use config::SecurityLevel;pub use debug::Breakpoint;pub use debug::CallFrame;pub use debug::DebugInfo;pub use debug::Debugger;pub use debug::Inspector;pub use debug::Profiler;pub use debug::ProfilingMetrics;pub use engine::Engine;pub use error::ApiError;pub use events::CallbackRegistry;pub use events::EventData;pub use events::EventEmitter;pub use events::EventManager;pub use events::EventChain;pub use interpreter::Interpreter;pub use modules::ModuleInfo;pub use modules::ModuleLoader;pub use modules::ModuleProvider;pub use modules::ModuleRegistry;pub use modules::FileSystemModuleProvider;