1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//! [Swift](https://www.swift.org) language exporter for [Specta](specta).
//!
//! This crate provides functionality to export Rust types to Swift code.
//!
//! # Usage
//!
//! Add `specta`, `specta-serde`, and `specta-swift` to your project:
//!
//! ```bash
//! cargo add specta@2.0.0-rc.25 --features derive,collect
//! cargo add specta-serde@0.0.12
//! cargo add specta-swift@0.0.3
//! ```
//!
//! Next copy the following into your `main.rs` file:
//!
//! ```rust
//! use specta::{Type, Types};
//! use specta_swift::Swift;
//!
//! #[derive(Type)]
//! pub struct MyType {
//! pub field: MyOtherType,
//! }
//!
//! #[derive(Type)]
//! pub struct MyOtherType {
//! pub other_field: String,
//! }
//!
//! let types = Types::default()
//! // We don't need to specify `MyOtherType` because it's referenced by `MyType`
//! .register::<MyType>();
//!
//! Swift::default()
//! .export_to("./Types.swift", &types, specta_serde::Format)
//! .unwrap();
//! ```
//!
//! Now you're set up with Specta Swift!
//!
//! If you get tired of listing all your types, checkout [`specta::collect`].
pub use Error;
pub use ;