MCPcopy Create free account
hub / github.com/GCWing/BitFun / parse_connection_method

Function parse_connection_method

src/apps/desktop/src/api/remote_connect_api.rs:507–526  ·  view source on GitHub ↗
(
    method: &str,
    custom_url: Option<String>,
    lan_ip: Option<String>,
)

Source from the content-addressed store, hash-verified

505}
506
507fn parse_connection_method(
508 method: &str,
509 custom_url: Option<String>,
510 lan_ip: Option<String>,
511) -> Result<ConnectionMethod, String> {
512 match method {
513 "lan" => Ok(ConnectionMethod::Lan {
514 ip: lan_ip.filter(|s| !s.is_empty()),
515 }),
516 "ngrok" => Ok(ConnectionMethod::Ngrok),
517 "bitfun_server" => Ok(ConnectionMethod::BitfunServer),
518 "custom_server" => Ok(ConnectionMethod::CustomServer {
519 url: custom_url.unwrap_or_default(),
520 }),
521 "bot_feishu" => Ok(ConnectionMethod::BotFeishu),
522 "bot_telegram" => Ok(ConnectionMethod::BotTelegram),
523 "bot_weixin" => Ok(ConnectionMethod::BotWeixin),
524 _ => Err(format!("unknown connection method: {method}")),
525 }
526}
527
528#[tauri::command]
529pub async fn remote_connect_start(

Callers 1

remote_connect_startFunction · 0.85

Calls 1

is_emptyMethod · 0.45

Tested by

no test coverage detected