Skip to content

Rust Client

Leonard Ramminger edited this page Aug 31, 2026 · 1 revision

Rust Client

Use YcallrClient when building Rust applications directly on the core library (not through FFI).

Dependency

ycallr-core = { version = "0.1", features = ["client"] }

For local development:

ycallr-core = { path = "../ycallr-core", features = ["client"] }

Typical flow

  1. Load a compiled profile (load_installed_profile or load_from_proto_bytes).
  2. Build a client with YcallrClient::builder() (env mode, auth overrides, base URL).
  3. Call client.call(command_path, params, optional_body).

Call engine

Request preparation lives in call_engine/. It builds PreparedHttpRequest with:

  • Resolved URL and path parameters
  • Headers, query, and auth
  • Body encoding (JSON, form, multipart, raw)
  • Response message templates (no network I/O)

Mock testing

Use test-utils and MockApiClient for in-memory tests without network access.

HTTP integration tests use mockito against the real reqwest stack.

Clone this wiki locally