Skip to main content

Crate motto

Crate motto 

Source
Expand description

§Motto - Compiler-as-a-Service for Multi-Platform SDK Generation

Motto transforms Rust schema.rs files into platform-specific SDK toolkits with a unified Single Source of Truth architecture.

§Architecture

  1. Static Analysis Frontend - Parses Rust AST using syn to extract structs and enums annotated for serialization. Computes SHA-256 fingerprint.

  2. Intermediate Representation (IR) - Language-agnostic JSON/BSON manifest with field offsets and bit-alignment requirements for Bitcode backend.

  3. Backend Emitters - Generate platform-specific code:

    • TypeScript/WASM (ESM with wasm-bindgen or napi-rs)
    • Swift (iOS/macOS native)
    • Kotlin (Android/JVM native)
    • Unity (C# with unsafe DllImport)
  4. Runtime - Bundled with SDK: bitcode, zstd, state machine, retry logic, WebTransport.

Re-exports§

pub use core::fingerprint::SchemaFingerprint;
pub use core::parser::SchemaParser;
pub use ir::generator::IrGenerator;
pub use ir::manifest::SchemaManifest;

Modules§

core
Core module - Static Analysis Frontend
emitters
Backend Emitters Module
ir
Intermediate Representation (IR) Module
prelude
Re-export commonly used types
runtime
Runtime Module

Constants§

PROTOCOL_VERSION_BYTE
Protocol version byte (derived from minor version of motto.lock) This is embedded in all generated packets for sidecar routing
VERSION
Version information derived from Cargo.toml