(input: &[u8])
| 156 | // Helper functions for safe parsing with error handling |
| 157 | |
| 158 | async fn parse_message_safely(input: &[u8]) -> Result<FrontendMessage, Box<dyn std::error::Error>> { |
| 159 | let mut cursor = Cursor::new(input); |
| 160 | let parser = MessageParser::new(); |
| 161 | |
| 162 | match parser.parse_message(&mut cursor).await { |
| 163 | Ok(msg) => Ok(msg), |
| 164 | Err(e) => Err(Box::new(e)) |
| 165 | } |
| 166 | } |
| 167 | |
| 168 | async fn parse_startup_message_safely(input: &[u8]) -> Result<StartupMessage, Box<dyn std::error::Error>> { |
| 169 | let mut cursor = Cursor::new(input); |
no test coverage detected