Encodes and attempts to write the most efficient string implementation to the given `Write`. # Errors This function will return `ValueWriteError` on any I/O error occurred while writing either the marker or the data, except the EINTR, which is handled internally. TODO: Docs, range check, example, visibility.
(wr: &mut W, data: &str)
| 647 | /// marker or the data, except the EINTR, which is handled internally. |
| 648 | // TODO: Docs, range check, example, visibility. |
| 649 | pub fn write_str<W>(wr: &mut W, data: &str) -> Result<(), ValueWriteError> |
| 650 | where W: Write |
| 651 | { |
| 652 | try!(write_str_len(wr, data.len() as u32)); |
| 653 | wr.write_all(data.as_bytes()).map_err(|err| ValueWriteError::InvalidDataWrite(WriteError(err))) |
| 654 | } |
| 655 | |
| 656 | /// Encodes and attempts to write the most efficient binary array length implementation to the given |
| 657 | /// write, returning the marker used. |
no test coverage detected