Change on_debugger to register_debugger.
This commit is contained in:
parent
389bb9bf66
commit
dca0185323
@ -264,7 +264,7 @@ impl Engine {
|
|||||||
/// Exported under the `debugging` feature only.
|
/// Exported under the `debugging` feature only.
|
||||||
#[cfg(feature = "debugging")]
|
#[cfg(feature = "debugging")]
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn on_debugger(
|
pub fn register_debugger(
|
||||||
&mut self,
|
&mut self,
|
||||||
init: impl Fn() -> Dynamic + SendSync + 'static,
|
init: impl Fn() -> Dynamic + SendSync + 'static,
|
||||||
callback: impl Fn(
|
callback: impl Fn(
|
||||||
|
@ -220,7 +220,7 @@ fn main() {
|
|||||||
// Hook up debugger
|
// Hook up debugger
|
||||||
let lines: Vec<_> = script.trim().split('\n').map(|s| s.to_string()).collect();
|
let lines: Vec<_> = script.trim().split('\n').map(|s| s.to_string()).collect();
|
||||||
|
|
||||||
engine.on_debugger(
|
engine.register_debugger(
|
||||||
// Store the current source in the debugger state
|
// Store the current source in the debugger state
|
||||||
|| "".into(),
|
|| "".into(),
|
||||||
// Main debugging interface
|
// Main debugging interface
|
||||||
|
@ -41,7 +41,7 @@ fn test_debugging() -> Result<(), Box<EvalAltResult>> {
|
|||||||
fn test_debugger_state() -> Result<(), Box<EvalAltResult>> {
|
fn test_debugger_state() -> Result<(), Box<EvalAltResult>> {
|
||||||
let mut engine = Engine::new();
|
let mut engine = Engine::new();
|
||||||
|
|
||||||
engine.on_debugger(
|
engine.register_debugger(
|
||||||
|| {
|
|| {
|
||||||
// Say, use an object map for the debugger state
|
// Say, use an object map for the debugger state
|
||||||
let mut state = Map::new();
|
let mut state = Map::new();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user