Debian Codegraph @

third_party/rust/uniffi_bindgen/src/bindings/mod.rs

raw
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5 //! Generate foreign language bindings for a uniffi component.
6 //!
7 //! This module contains all the code for generating foreign language bindings,
8 //! along with some helpers for executing foreign language scripts or tests.
9
10 mod kotlin;
11 pub use kotlin::KotlinBindingGenerator;
12 pub mod python;
13 pub use python::PythonBindingGenerator;
14 mod ruby;
15 pub use ruby::RubyBindingGenerator;
16 mod swift;
17 pub use swift::{generate_swift_bindings, SwiftBindingGenerator, SwiftBindingsOptions};
18
19 #[cfg(feature = "bindgen-tests")]
20 pub use self::{
21 kotlin::test as kotlin_test, python::test as python_test, ruby::test as ruby_test,
22 swift::test as swift_test,
23 };
24
25 #[cfg(feature = "bindgen-tests")]
26 /// Mode for the `run_script` function defined for each language
27 #[derive(Clone, Debug)]
28 pub struct RunScriptOptions {
29 pub show_compiler_messages: bool,
30 }
31
32 #[cfg(feature = "bindgen-tests")]
33 impl Default for RunScriptOptions {
34 fn default() -> Self {
35 Self {
36 show_compiler_messages: true,
37 }
38 }
39 }