[]Function sc_network::multiaddr::from_url

pub fn from_url(url: &str) -> Result<Multiaddr, FromUrlErr>

Attempts to parse an URL into a multiaddress.

This function will return an error if some information in the URL cannot be retained in the generated multiaddress. This includes a username, password, path (if not supported by the multiaddr), and query string.

This function is only present if the url feature is enabled, and it is enabled by default.

The supported URL schemes are:

Example

let addr = parity_multiaddr::from_url("ws://127.0.0.1:8080/").unwrap();
assert_eq!(addr, "/ip4/127.0.0.1/tcp/8080/ws".parse().unwrap());