1use serde::{Deserialize, Serialize};
2
3pub mod build_defaults;
4pub mod clean_defaults;
5pub mod derive;
6pub mod dto;
7pub mod e2e;
8pub mod extras;
9pub mod languages;
10pub mod legacy;
11pub mod lint_defaults;
12pub mod new_config;
13pub mod output;
14pub mod publish;
15pub mod raw_crate;
16pub mod resolve_helpers;
17pub mod resolved;
18pub mod setup_defaults;
19pub mod test_defaults;
20pub mod tools;
21pub mod trait_bridge;
22pub mod update_defaults;
23pub mod validation;
24pub mod workspace;
25
26pub use derive::{derive_go_module_from_repo, derive_repo_org, derive_reverse_dns_package};
28pub use dto::{
29 CsharpDtoStyle, DtoConfig, ElixirDtoStyle, GoDtoStyle, JavaDtoStyle, NodeDtoStyle, PhpDtoStyle, PythonDtoStyle,
30 RDtoStyle, RubyDtoStyle,
31};
32pub use e2e::E2eConfig;
33pub use extras::{AdapterConfig, AdapterParam, AdapterPattern, Language};
34pub use languages::{
35 CSharpConfig, CapsuleTypeConfig, CustomModulesConfig, CustomRegistration, CustomRegistrationsConfig, DartConfig,
36 DartStyle, ElixirConfig, FfiConfig, GleamConfig, GleamElementConstructor, GleamElementField, GoConfig, JavaConfig,
37 JniConfig, KotlinAndroidConfig, KotlinConfig, KotlinFfiStyle, KotlinTarget, NapiTypeTagConfig,
38 NodeCapsuleTypeConfig, NodeConfig, PhpConfig, PythonConfig, RConfig, RubyConfig, StubsConfig, SwiftConfig,
39 WasmConfig, ZigConfig,
40};
41pub use legacy::{LegacyConfigError, LegacyKey, detect_legacy_keys};
42pub use new_config::{NewAlefConfig, ResolveError};
43pub use output::{
44 BuildCommandConfig, CleanConfig, ExcludeConfig, GeneratedHeaderConfig, IncludeConfig, LintConfig, OutputConfig,
45 OutputTemplate, PrecommitConfig, ReadmeConfig, ScaffoldCargo, ScaffoldCargoEnvValue, ScaffoldCargoTargets,
46 ScaffoldConfig, SetupConfig, SyncConfig, TestConfig, TextReplacement, UpdateConfig,
47};
48pub use publish::{PublishConfig, PublishLanguageConfig, VendorMode};
49pub use raw_crate::RawCrateConfig;
50pub use resolve_helpers::{detect_serde_available, resolve_output_dir};
51pub use resolved::ResolvedCrateConfig;
52pub use tools::{DEFAULT_RUST_DEV_TOOLS, LangContext, ToolsConfig, require_tool, require_tools};
53pub use trait_bridge::{BridgeBinding, TraitBridgeConfig};
54pub use workspace::WorkspaceConfig;
55
56#[derive(Debug, Clone, Serialize, Deserialize)]
58pub struct SourceCrate {
59 pub name: String,
61 pub sources: Vec<std::path::PathBuf>,
63}
64
65fn default_true() -> bool {
66 true
67}
68
69#[derive(Debug, Clone, Serialize, Deserialize)]
73pub struct GenerateConfig {
74 #[serde(default = "default_true")]
76 pub bindings: bool,
77 #[serde(default = "default_true")]
79 pub errors: bool,
80 #[serde(default = "default_true")]
82 pub configs: bool,
83 #[serde(default = "default_true")]
85 pub async_wrappers: bool,
86 #[serde(default = "default_true")]
88 pub type_conversions: bool,
89 #[serde(default = "default_true")]
91 pub package_metadata: bool,
92 #[serde(default = "default_true")]
94 pub public_api: bool,
95 #[serde(default = "default_true")]
98 pub reverse_conversions: bool,
99}
100
101impl Default for GenerateConfig {
102 fn default() -> Self {
103 Self {
104 bindings: true,
105 errors: true,
106 configs: true,
107 async_wrappers: true,
108 type_conversions: true,
109 package_metadata: true,
110 public_api: true,
111 reverse_conversions: true,
112 }
113 }
114}
115
116#[derive(Debug, Clone, Serialize, Deserialize)]
120pub struct FormatConfig {
121 #[serde(default = "default_true")]
125 pub enabled: bool,
126 #[serde(default)]
130 pub command: Option<String>,
131}
132
133impl Default for FormatConfig {
134 fn default() -> Self {
135 Self {
136 enabled: true,
137 command: None,
138 }
139 }
140}