MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / parse_http_addr

Function parse_http_addr

tests/all/guest_debug/mod.rs:254–262  ·  view source on GitHub ↗

Parse an HTTP serve address from a "Serving HTTP on http://addr/" line.

(line: &str)

Source from the content-addressed store, hash-verified

252
253/// Parse an HTTP serve address from a "Serving HTTP on http://addr/" line.
254fn parse_http_addr(line: &str) -> Result<SocketAddr> {
255 line.find("127.0.0.1")
256 .and_then(|start| {
257 let addr = &line[start..];
258 let end = addr.find('/')?;
259 addr[..end].parse().ok()
260 })
261 .ok_or_else(|| format_err!("failed to parse HTTP address from: {line}"))
262}
263
264/// Start serve under debugger, continue, and send multiple HTTP requests
265/// to verify instance reuse works correctly under the debugger.

Callers 2

Calls 3

findMethod · 0.45
okMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected