sqlx-core-oldapi 0.6.53

Core of SQLx, the rust SQL toolkit. Not intended to be used directly.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
pub trait MssqlBufMutExt {
    fn put_b_varchar(&mut self, s: &str);
    fn put_utf16_str(&mut self, s: &str);
}

impl MssqlBufMutExt for Vec<u8> {
    fn put_utf16_str(&mut self, s: &str) {
        let enc = s.encode_utf16();
        for ch in enc {
            self.extend_from_slice(&ch.to_le_bytes());
        }
    }

    fn put_b_varchar(&mut self, s: &str) {
        self.extend(&(s.len() as u8).to_le_bytes());
        self.put_utf16_str(s);
    }
}