Skip to main content

Crate lexe_api_core

Crate lexe_api_core 

Source
Expand description

Core Lexe API definitions, types and traits.

§Notes on API types

§Query parameters

When serializing data as query parameters, we have to wrap newtypes in these structs (instead of e.g. using UserPk directly), otherwise serde_qs errors with “top-level serializer supports only maps and structs.”

§serde(flatten)

Also beware when using #[serde(flatten)] on a field. All inner fields must be string-ish types (&str, String, Cow<’_, str>, etc…) OR use SerializeDisplay and DeserializeFromStr from serde_with.

This issue is due to a limitation in serde. See: https://github.com/serde-rs/serde/issues/1183

Modules§

cli
Enclave CLI args and types.
def
Traits defining Lexe’s various APIs.
error
API error types. Serializable api error types and error kinds returned by various lexe services.
macros
Macros for API clients/servers.
models
API request and response types unique to a specific endpoint.
types
API types shared across multiple endpoints.
vfs
Lexe’s VFS (“virtual file system”) trait and associated types. Virtual File System (‘vfs’)

Macros§

api_error
This macro takes the name of an ApiError and its error kind type to generate the various impls required by the ApiError trait alias.
api_error_kind
This macro takes an error kind enum declaration and generates impls for the trait ApiErrorKind (and its dependent traits).
user_agent_to_external
Build the user agent string used for requests to external services at compile time.
user_agent_to_lexe
Build the user agent string used for requests to Lexe infrastructure at compile time. We format as <crate>/<version>, consistent with RFC 9110 Section 10.1.5.