Skip to main content

lexe_api_core/
lib.rs

1//! Core Lexe API definitions, types and traits.
2//!
3//! # Notes on API types
4//!
5//! ## Query parameters
6//!
7//! When serializing data as query parameters, we have to wrap newtypes in these
8//! structs (instead of e.g. using UserPk directly), otherwise `serde_qs` errors
9//! with "top-level serializer supports only maps and structs."
10//!
11//! ## `serde(flatten)`
12//!
13//! Also beware when using `#[serde(flatten)]` on a field. All inner fields must
14//! be string-ish types (&str, String, Cow<'_, str>, etc...) OR use
15//! `SerializeDisplay` and `DeserializeFromStr` from `serde_with`.
16//!
17//! This issue is due to a limitation in serde. See:
18//! <https://github.com/serde-rs/serde/issues/1183>
19
20/// Enclave CLI args and types.
21pub mod cli;
22/// Traits defining Lexe's various APIs.
23pub mod def;
24/// API error types.
25// TODO(max): This will be replaced by LexeError
26pub mod error;
27/// Macros for API clients/servers.
28pub mod macros;
29/// API request and response types unique to a specific endpoint.
30pub mod models;
31/// API types shared across multiple endpoints.
32pub mod types;
33/// Lexe's VFS ("virtual file system") trait and associated types.
34pub mod vfs;
35
36/// Axum helpers which must live in `lexe_api_core` because its dependents do.
37#[cfg(feature = "axum")]
38pub mod axum_helpers;