MCPcopy Create free account
hub / github.com/d0iasm/saba / parse

Method parse

core/src/url.rs:32–43  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

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://")

Callers 3

newMethod · 0.80
handle_urlFunction · 0.80
handle_urlFunction · 0.80

Calls 6

is_httpMethod · 0.80
to_stringMethod · 0.80
extract_hostMethod · 0.80
extract_portMethod · 0.80
extract_pathMethod · 0.80
extract_searchpartMethod · 0.80

Tested by

no test coverage detected