(&self, cursor: &mut Cursor<&[u8]>, _length: u32)
| 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(); |
no test coverage detected