Skip to main content

Crate xplane_web_api

Crate xplane_web_api 

Source
Expand description

Typed client crate for the documented X-Plane local web API.

  • REST API: generated from OpenAPI at build time with Progenitor.
  • WebSocket API: typed request/response models and a small async client.
  • CLI: optional command-line interface for REST operations.
  • Error: shared typed REST error classification helpers.

§Basic REST Example

use xplane_web_api::error::RestClientError;
use xplane_web_api::rest::{Client, DEFAULT_REST_API_BASE_URL};

async fn fetch_capabilities() -> Result<(), RestClientError> {
    let client = Client::new(DEFAULT_REST_API_BASE_URL);
    let response = client
        .get_capabilities()
        .await
        .map_err(RestClientError::from)?;

    println!("{:#?}", response.as_ref());
    Ok(())
}

Modules§

error
Shared REST error classification helpers for generated client operations. REST client error classification helpers.
rest
Generated REST client and OpenAPI-derived request/response types.