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

Method decode

src/protocol/codec.rs:36–48  ·  view source on GitHub ↗
(&mut self, src: &mut BytesMut)

Source from the content-addressed store, hash-verified

34 type Error = io::Error;
35
36 fn decode(&mut self, src: &mut BytesMut) -> Result<Option<Self::Item>, Self::Error> {
37 match self.state {
38 CodecState::WaitingForStartup => {
39 if let Some(msg) = decode_startup_message(src)? {
40 self.state = CodecState::Normal;
41 Ok(Some(msg))
42 } else {
43 Ok(None)
44 }
45 }
46 CodecState::Normal => decode_normal_message(src),
47 }
48 }
49}
50
51impl Encoder<BackendMessage> for PostgresCodec {

Callers 3

test_decode_queryFunction · 0.80
mainFunction · 0.80

Calls 2

decode_startup_messageFunction · 0.85
decode_normal_messageFunction · 0.85

Tested by 3

test_decode_queryFunction · 0.64
mainFunction · 0.64