[][src]Function termscp::utils::parser::parse_remote_opt

pub fn parse_remote_opt(
    remote: &str
) -> Result<(String, u16, FileTransferProtocol, Option<String>), String>

parse_remote_opt

Parse remote option string. Returns in case of success a tuple made of (address, port, protocol, username) For ssh if username is not provided, current user will be used. In case of error, message is returned If port is missing default port will be used for each protocol SFTP => 22 FTP => 21 The option string has the following syntax [protocol]://[username]@{address}:[port] The only argument which is mandatory is address NOTE: possible strings

  • 172.26.104.1
  • root@172.26.104.1
  • sftp://root@172.26.104.1
  • sftp://172.26.104.1:4022
  • sftp://172.26.104.1
  • ...