pub fn mask_url(url: &str) -> StringExpand description
Masks a URL by showing only the scheme and host, hiding the path and query parameters.
This is used to safely display RPC URLs in API responses and logs without exposing sensitive API keys that are often embedded in the URL path or query string.
§Examples
https://eth-mainnet.g.alchemy.com/v2/abc123→https://eth-mainnet.g.alchemy.com/***https://mainnet.infura.io/v3/PROJECT_ID→https://mainnet.infura.io/***http://localhost:8545→http://localhost:8545(no path to mask)invalid-url→***(fallback for unparsable URLs)