Requirements

  • Rust ≥ 1.76 (stable)
  • The native FFI lib telequick_core_ffi.so / .dylib / .dll somewhere on disk — the SDK loads it dynamically via libloading.

Add the dependency

[dependencies]
telequick = "0.1"
tokio = {{ version = "1", features = ["macros", "rt-multi-thread"] }}
The SDK uses quinn internally for QUIC transport.

Locating the FFI lib

Unlike the Go and .NET SDKs, the Rust SDK does not assume a system library path. You pass the absolute path to the .so to TeleQuickClient::new:
let client = TeleQuickClient::new(
    "quic://engine.telequick.dev:9090",
    "/usr/local/lib/telequick_core_ffi.so",
)?;
This is intentional — embedding scenarios (alpine images, scratch containers, lambda layers) can have wildly different layouts. A common pattern: read from TELEQUICK_LIB_PATH first, fall back to an OS default:
fn lib_path() -> String {{
    std::env::var("TELEQUICK_LIB_PATH").unwrap_or_else(|_| {{
        if cfg!(target_os = "macos") {{
            "/usr/local/lib/telequick_core_ffi.dylib".into()
        }} else if cfg!(target_os = "windows") {{
            "C:/Program Files/TeleQuick/telequick_core_ffi.dll".into()
        }} else {{
            "/usr/local/lib/telequick_core_ffi.so".into()
        }}
    }})
}}

Smoke test

use telequick::TeleQuickClient;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {{
    let client = TeleQuickClient::new(
        "quic://engine.telequick.dev:9090",
        "/usr/local/lib/telequick_core_ffi.so",
    )?;
    println!("client built: {{}} bytes lib loaded", std::mem::size_of_val(&client));
    Ok(())
}}