MCPcopy Create free account
hub / github.com/erans/pgsqlite / encode_notice_response

Function encode_notice_response

src/protocol/codec.rs:346–373  ·  view source on GitHub ↗
(notice: NoticeResponse, dst: &mut BytesMut)

Source from the content-addressed store, hash-verified

344}
345
346fn 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, &notice.severity);
353
354 dst.put_u8(b'C');
355 put_cstring(dst, &notice.code);
356
357 dst.put_u8(b'M');
358 put_cstring(dst, &notice.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
375fn encode_parse_complete(dst: &mut BytesMut) {
376 dst.put_u8(b'1');

Callers 1

encodeMethod · 0.85

Calls 3

put_cstringFunction · 0.85
update_message_lengthFunction · 0.85
lenMethod · 0.45

Tested by

no test coverage detected