pub fn value_from_bytes(
bytes: Vec<u8>,
span: Span,
type_: ByteStreamType,
trim_trailing_newline: bool,
) -> ValueExpand description
Convert already-collected stream bytes into a Value.
Shared by ByteStream::into_value (for ByteStreamType::Unknown) and interactive
last-result capture of a byte-stream prefix.
ByteStreamType::Binary→ binary (no decode)ByteStreamType::String/ByteStreamType::Unknown→ UTF-8 string when valid, else binary
Incomplete multi-byte sequences at the end (typical when a prefix is truncated to a budget) keep the valid UTF-8 prefix as a string rather than failing the whole buffer to binary.
When trim_trailing_newline is true, a single trailing \n or \r\n is stripped, matching
collected external/file values.