(credentials: &FtpCredentials)
| 19 | } |
| 20 | |
| 21 | pub async fn test_connection(credentials: &FtpCredentials) -> Result<(), String> { |
| 22 | if credentials.is_secure { |
| 23 | match secure_connect(credentials).await { |
| 24 | Ok(mut ftp_stream) => { |
| 25 | disconnect(None, Some(&mut ftp_stream)).await; |
| 26 | Ok(()) |
| 27 | } |
| 28 | Err(err) => Err(format!("Failed to connect: {}", err)), |
| 29 | } |
| 30 | } else { |
| 31 | match insecure_connect(credentials).await { |
| 32 | Ok(mut ftp_stream) => { |
| 33 | disconnect(Some(&mut ftp_stream), None).await; |
| 34 | Ok(()) |
| 35 | } |
| 36 | Err(err) => Err(format!("Failed to connect: {}", err)), |
| 37 | } |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | pub async fn list_objects( |
| 42 | credentials: &FtpCredentials, |
no test coverage detected