(&mut self)
| 30 | } |
| 31 | |
| 32 | pub fn parse(&mut self) -> Result<Self, String> { |
| 33 | if !self.is_http() { |
| 34 | return Err("Only HTTP scheme is supported.".to_string()); |
| 35 | } |
| 36 | |
| 37 | self.host = self.extract_host(); |
| 38 | self.port = self.extract_port(); |
| 39 | self.path = self.extract_path(); |
| 40 | self.searchpart = self.extract_searchpart(); |
| 41 | |
| 42 | Ok(self.clone()) |
| 43 | } |
| 44 | |
| 45 | fn is_http(&self) -> bool { |
| 46 | self.url.contains("http://") |
no test coverage detected