This commit is contained in:
Andy Gayton 2024-06-23 09:43:46 -04:00
parent 13db47eb25
commit a828eb351d
2 changed files with 3 additions and 2 deletions

View File

@ -50,7 +50,7 @@ struct RunningPlugin {
interface: PluginInterface, interface: PluginInterface,
/// Garbage collector for the plugin /// Garbage collector for the plugin
gc: PluginGc, gc: PluginGc,
/// todo: docs /// RAII guard for this plugin's ctrl-c handler
_ctrlc_guard: Option<ctrlc::Guard>, _ctrlc_guard: Option<ctrlc::Guard>,
} }

View File

@ -501,7 +501,8 @@ impl EngineInterface {
self.state.writer.is_stdout() self.state.writer.is_stdout()
} }
/// todo: docs /// Register a closure which will be called when the engine receives a Ctrl-C signal. Returns a
/// RAII guard that will keep the closure alive until it is dropped.
pub fn register_ctrlc_handler(&self, handler: ctrlc::Handler) -> ctrlc::Guard { pub fn register_ctrlc_handler(&self, handler: ctrlc::Handler) -> ctrlc::Guard {
self.state.ctrlc_handlers.register(handler) self.state.ctrlc_handlers.register(handler)
} }