py-rs 0.1.1

generate python bindings from rust types
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#![cfg(feature = "bson-uuid-impl")]

use bson::{oid::ObjectId, Uuid};
use py_rs::PY;

#[derive(PY)]
#[py(export, export_to = "bson/")]
struct User {
    _id: ObjectId,
    _uuid: Uuid,
}

#[test]
fn bson() {
    assert_eq!(User::decl(), "type User = { _id: string, _uuid: string, };")
}