Function nu_plugin::serve_plugin
source · pub fn serve_plugin(
plugin: &mut impl StreamingPlugin,
encoder: impl PluginEncoder + 'static
)
Expand description
Function used to implement the communication protocol between nushell and an external plugin. Both Plugin and StreamingPlugin are supported.
When creating a new plugin this function is typically used as the main entry point for the plugin, e.g.
fn main() {
serve_plugin(&mut MyPlugin::new(), MsgPackSerializer)
}