Module utils

Source
Expand description

Some useful functions

Modules§

dns
This module create a DnsResolver future task to DNS resolver

Enums§

TransportType
Transport type on tentacle

Functions§

extract_peer_id
Get peer id from multiaddr
find_type
Confirm the transport used by multiaddress
is_reachable
Check if the ip address is reachable. Copy from std::net::IpAddr::is_global
multiaddr_to_socketaddr
Change multiaddr to socketaddr
redact_auth_from_url
Function to redact the username and password from a URL: This function takes a URL of the form “https://user:password@example.com/path?key=value#hash” and returns a modified version where the password is replaced with “”, resulting in: “https://user:@example.com/path?key=value#hash”. If the URL does not contain a username or password, it is returned unchanged. Returns a Cow<'_, Url> to manage ownership efficiently, using Borrowed when possible.
socketaddr_to_multiaddr
convert socket address to multiaddr