Skip to main content

Module swift

Module swift 

Source
Expand description

Swift code generation for vox services.

This module generates Swift client and server code from service definitions. The generated code includes:

  • Type definitions for all named types (structs, enums)
  • Caller protocol and client implementation for making RPC calls
  • Handler protocol for implementing services
  • Dispatcher for routing incoming calls
  • Encoding/decoding logic for all types
  • Runtime schema information for channel binding

Re-exports§

pub use client::generate_client;
pub use descriptor::generate_service_value_descriptors;
pub use descriptor::generate_value_descriptors;
pub use encode::generate_named_type_encode_fns;
pub use schema::generate_schemas;
pub use server::generate_server;
pub use types::collect_named_types;
pub use types::generate_named_types;

Modules§

client
Swift client generation.
decode
Swift decoding statement generation.
descriptor
Swift value descriptor generation.
encode
Swift encoding expression/statement generation.
schema
Swift schema generation for wire schema exchange.
server
Swift server/handler generation.
types
Swift type generation and collection.
wire
Swift wire type code generation.

Enums§

SwiftBindings
Controls which Swift bindings are generated for a service.

Functions§

generate_common_types
Generate a Swift module containing only the named-type declarations + encoders referenced by the given services, deduplicated by type name. Each type is emitted exactly once even if multiple services reference it.
generate_method_ids
Generate method IDs as a Swift enum.
generate_service
Generate a complete Swift module for a service.
generate_service_with_bindings
Generate a Swift module for a service with explicit client/server selection.
generate_service_without_types
Like generate_service_with_bindings, but emits no named-type declarations or named-type encoders. Use this together with generate_common_types when several services share types and you want them in a single “common” file rather than duplicated in every per-service file.