Function decode_utf8_string
Source pub fn decode_utf8_string(input: TakeBytes) -> Result<String, DecodingError>
Expand description
Read the entire contents from the input source and decode as UTF-8.
§Errors
Returns an error if:
- Reading from the source fails
- The contents are not valid UTF-8
§Example
ⓘuse take_bytes::{TakeBytes, decode_utf8_string};
let input: TakeBytes = "-".parse()?;
let text = decode_utf8_string(input)?;