#schema #protocols #bindings #applications #schema-version #data #receipt

versa

Versa types and utilities for developing Versa client applications in Rust

26 releases (9 breaking)

new 0.19.1 Dec 10, 2024
0.18.0 Nov 20, 2024

#1042 in Database interfaces

Download history 287/week @ 2024-09-09 11/week @ 2024-09-16 144/week @ 2024-09-23 26/week @ 2024-09-30 447/week @ 2024-10-07 1448/week @ 2024-10-14 466/week @ 2024-10-21 152/week @ 2024-10-28 436/week @ 2024-11-04 80/week @ 2024-11-11 175/week @ 2024-11-18 26/week @ 2024-11-25 86/week @ 2024-12-02

428 downloads per month

MIT license

250KB
6K SLoC

Versa Rust

This crate is the official Versa SDK for Rust.

Versa uses semantic versioning to ensure the stability of its data model. The current schema version 1.8.0

You can use this crate broadly in two ways: either just referencing the type bindings, or to implement a custom client in Rust.

You will need to enable either the client_sender or client_receiver feature to leverage the corresponding client implementation.

Type Bindings

There are broadly two kinds of types represented in this repository: Protocol Bindings and the Receipt Schema

This repository references the root JSON schema files, at https://github.com/versa-protocol/schema, to generate the Rust bindings for a Versa receipt.

Protocol Bindings

Protocol Bindings represent the types of requests, responses, and error codes to be expected when developing client implementations according to the specifications of the Versa Protocol. These types are defined in the protocol directory.

Receipt Schema

The Receipt struct represents the receipt and invoice data schemas to be handled when developing client implementations according to the specifications of the Versa Protocol. These types are defined in receipt.rs

Build Process

This crate uses the typify crate to construct the receipt schema bindings from our json schema

Features

  • client Enables Versa client initialization with customer registration APIs
  • client_sender Enables the Versa sending client implementation
  • client_receiver Enables the Versa receiving client implementation
  • diesel Implements diesel traits for MySQL on certain structs (UNSTABLE: Use with caution)

TODO

  • Rust stable crate
  • Expanded diesel database support

Dependencies

~7–20MB
~291K SLoC