MCPcopy Create free account
hub / github.com/BitVM/BitVM / test_connection

Function test_connection

bridge/src/client/data_store/ftp/lib.rs:21–39  ·  view source on GitHub ↗
(credentials: &FtpCredentials)

Source from the content-addressed store, hash-verified

19}
20
21pub 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
41pub async fn list_objects(
42 credentials: &FtpCredentials,

Callers 2

newMethod · 0.70
newMethod · 0.70

Calls 3

secure_connectFunction · 0.85
insecure_connectFunction · 0.85
disconnectFunction · 0.70

Tested by

no test coverage detected