nu_plugin_engine

Function get_plugin_encoding

Source
pub fn get_plugin_encoding(
    child_stdout: &mut impl Read,
) -> Result<EncodingType, ShellError>
Expand description

Determine the plugin’s encoding from a freshly opened stream.

The plugin is expected to send a 1-byte length and either json or msgpack, so this reads that and determines the right length.