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

Method parse_describe

src/protocol/parser.rs:334–346  ·  view source on GitHub ↗
(&self, cursor: &mut Cursor<&[u8]>, _length: u32)

Source from the content-addressed store, hash-verified

332 }
333
334 async fn parse_describe(&self, cursor: &mut Cursor<&[u8]>, _length: u32) -> Result<FrontendMessage, ParseError> {
335 let describe_type = cursor.read_u8()?;
336 let name = self.read_cstring(cursor).await?;
337
338 if describe_type != b'S' && describe_type != b'P' {
339 return Err(ParseError::ProtocolViolation("Invalid describe type".to_string()));
340 }
341
342 Ok(FrontendMessage::Describe {
343 typ: describe_type,
344 name,
345 })
346 }
347
348 async fn read_cstring(&self, cursor: &mut Cursor<&[u8]>) -> Result<String, ParseError> {
349 let mut bytes = Vec::new();

Callers 1

parse_messageMethod · 0.80

Calls 1

read_cstringMethod · 0.80

Tested by

no test coverage detected