(s: &str, buf: &mut BytesMut)
| 114 | } |
| 115 | |
| 116 | fn write_cstr(s: &str, buf: &mut BytesMut) { |
| 117 | // strings used inside library dont contain c style null bytes. |
| 118 | // debug assertions is enough for catching violation. |
| 119 | #[cfg(debug_assertions)] |
| 120 | if s.as_bytes().contains(&0) { |
| 121 | panic!("input string: {s} contains embedded null") |
| 122 | } |
| 123 | |
| 124 | buf.put_slice(s.as_bytes()); |
| 125 | buf.put_u8(0); |
| 126 | } |
| 127 | |
| 128 | // hard coded reesult format to always ask for binary output from server |
| 129 | fn result_fmt_binary(buf: &mut BytesMut) { |