MCPcopy Create free account
hub / github.com/HFQR/xitca-web / write_cstr

Function write_cstr

postgres/src/protocol.rs:116–126  ·  view source on GitHub ↗
(s: &str, buf: &mut BytesMut)

Source from the content-addressed store, hash-verified

114}
115
116fn 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
129fn result_fmt_binary(buf: &mut BytesMut) {

Callers 3

bindFunction · 0.85
executeFunction · 0.85
closeFunction · 0.85

Calls 2

containsMethod · 0.45
put_sliceMethod · 0.45

Tested by

no test coverage detected