mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 08:55:40 +02:00
Add string stream and binary stream, add text decoding (#570)
* WIP * Add binary/string streams and text decoding * Make string collection fallible * Oops, forgot pretty hex * Oops, forgot pretty hex * clippy
This commit is contained in:
@ -72,7 +72,7 @@ impl Command for PluginDeclaration {
|
||||
|
||||
let input = match input {
|
||||
PipelineData::Value(value, ..) => value,
|
||||
PipelineData::Stream(stream, ..) => {
|
||||
PipelineData::ListStream(stream, ..) => {
|
||||
let values = stream.collect::<Vec<Value>>();
|
||||
|
||||
Value::List {
|
||||
@ -80,6 +80,22 @@ impl Command for PluginDeclaration {
|
||||
span: call.head,
|
||||
}
|
||||
}
|
||||
PipelineData::StringStream(stream, ..) => {
|
||||
let val = stream.into_string("")?;
|
||||
|
||||
Value::String {
|
||||
val,
|
||||
span: call.head,
|
||||
}
|
||||
}
|
||||
PipelineData::ByteStream(stream, ..) => {
|
||||
let val = stream.into_vec();
|
||||
|
||||
Value::Binary {
|
||||
val,
|
||||
span: call.head,
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Create message to plugin to indicate that signature is required and
|
||||
|
Reference in New Issue
Block a user