(values: &[Option<&str>])
| 190 | } |
| 191 | |
| 192 | pub fn data_row(values: &[Option<&str>]) -> Vec<u8> { |
| 193 | let mut list = BufferList::new(); |
| 194 | list.add_int16(values.len() as i16); |
| 195 | for value in values { |
| 196 | match value { |
| 197 | Some(val) => { |
| 198 | let bytes = val.as_bytes(); |
| 199 | list.add_int32(bytes.len() as i32); |
| 200 | list.add_bytes(bytes); |
| 201 | } |
| 202 | None => { |
| 203 | list.add_int32(-1); |
| 204 | } |
| 205 | } |
| 206 | } |
| 207 | list.join(true, Some(b'D')) |
| 208 | } |
| 209 | |
| 210 | pub fn error(fields: &[(&str, &str)]) -> Vec<u8> { |
| 211 | error_or_notice(fields).join(true, Some(b'E')) |
no test coverage detected