pub type Credential = Option<(String, Option<String>)>;Expand description
Split scheme://user:pass@host/path into the URL without the credential, and the credential.
The credential must not stay in the request URL: some servers log the request line, and
bitcoind wants it in Authorization regardless. Returns the URL unchanged and None when
there is no userinfo.
Splitting is done by hand rather than with a URL crate because the only decision here is
where the authority ends, and a parser would also percent-decode — which this deliberately
does not do, since it would change a password containing % into a different password.
A credential needing percent-encoding should be passed through rpc_user/rpc_password,
where no encoding is involved at all.
Aliased Type§
pub enum Credential {
None,
Some((String, Option<String>)),
}