nu_plugin_engine

Function make_plugin_interface_with_streams

Source
pub fn make_plugin_interface_with_streams(
    reader: impl Read + Send + 'static,
    writer: impl Write + Send + 'static,
    after_close: impl FnOnce() + Send + 'static,
    source: Arc<PluginSource>,
    pid: Option<u32>,
    gc: Option<PluginGc>,
) -> Result<PluginInterface, ShellError>
Expand description

Create a plugin interface from low-level components.

  • after_close is called to clean up after the reader ends.
  • source is required so that custom values produced by the plugin can spawn it.
  • pid may be provided for process management (e.g. EnterForeground).
  • gc may be provided for communication with the plugin’s GC (e.g. SetGcDisabled).