(notice: NoticeResponse, dst: &mut BytesMut)
| 344 | } |
| 345 | |
| 346 | fn encode_notice_response(notice: NoticeResponse, dst: &mut BytesMut) { |
| 347 | dst.put_u8(b'N'); |
| 348 | let len_pos = dst.len(); |
| 349 | dst.put_i32(0); // Placeholder |
| 350 | |
| 351 | dst.put_u8(b'S'); |
| 352 | put_cstring(dst, ¬ice.severity); |
| 353 | |
| 354 | dst.put_u8(b'C'); |
| 355 | put_cstring(dst, ¬ice.code); |
| 356 | |
| 357 | dst.put_u8(b'M'); |
| 358 | put_cstring(dst, ¬ice.message); |
| 359 | |
| 360 | if let Some(ref detail) = notice.detail { |
| 361 | dst.put_u8(b'D'); |
| 362 | put_cstring(dst, detail); |
| 363 | } |
| 364 | |
| 365 | if let Some(ref hint) = notice.hint { |
| 366 | dst.put_u8(b'H'); |
| 367 | put_cstring(dst, hint); |
| 368 | } |
| 369 | |
| 370 | dst.put_u8(0); |
| 371 | |
| 372 | update_message_length(dst, len_pos); |
| 373 | } |
| 374 | |
| 375 | fn encode_parse_complete(dst: &mut BytesMut) { |
| 376 | dst.put_u8(b'1'); |
no test coverage detected