(params: &[(&str, &str)])
| 1106 | } |
| 1107 | |
| 1108 | fn startup_message_with(params: &[(&str, &str)]) -> Vec<u8> { |
| 1109 | let mut body = Vec::new(); |
| 1110 | body.extend_from_slice(&3_i16.to_be_bytes()); |
| 1111 | body.extend_from_slice(&0_i16.to_be_bytes()); |
| 1112 | for (key, value) in params { |
| 1113 | add_cstring(&mut body, key); |
| 1114 | add_cstring(&mut body, value); |
| 1115 | } |
| 1116 | add_cstring(&mut body, ""); |
| 1117 | |
| 1118 | let mut packet = Vec::with_capacity(body.len() + 4); |
| 1119 | packet.extend_from_slice(&((body.len() + 4) as i32).to_be_bytes()); |
| 1120 | packet.extend_from_slice(&body); |
| 1121 | packet |
| 1122 | } |
| 1123 | |
| 1124 | fn query_message(sql: &str) -> Vec<u8> { |
| 1125 | let mut body = Vec::new(); |
no test coverage detected