Skip to main content

Crate nym_bridges_types

Crate nym_bridges_types 

Source
Expand description

Minimal compatible Types shared between nym-bridges and other crates.

§Abstract

  • This crate contains all types necessary for interaction with crates (nym-vpn-lib-types) and others
  • Types visible via bindings should contain proper attributes and feature gated to uniffi-bindings for uniffi, typescript-bindings for TypeScript bindings.
  • TypeScript bindings use serde for conversion from Rust to TS and feature-gated to typescript-bindings.
  • Be mindful of limitations of TypeScript and uniffi limitations. Keep exported types simple.

§Dependency considerations

Please keep direct dependencies to other crates to a minimum to avoid dependency conflicts which can happen, especially when using it in other large projects such as Tauri.

§Supported bindings

  1. uniffi bindings (feature flag: uniffi-bindings). The following limitations apply:
  • Namespaces are not supported, all exported types should have unique names.
  • Not all types are supported or can be bridged. Keep exported types simple.
  1. TypeScript bindings using ts-rs (feature flag: typescript-bindings). Serialization (using serde) uses snake_case.

    Run the following command to generate TypeScript bindings:

    cargo test -p nym-vpn-lib-types -F typescript-bindings

§Serde support

Serde can be enabled using serde feature flag.

Modules§

quic
tls

Structs§

PersistedClientConfig

Enums§

ClientConfig