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 manifest_extras;
13pub mod new_config;
14pub mod output;
15pub mod publish;
16pub mod raw_crate;
17pub mod resolve_helpers;
18pub mod resolved;
19pub mod setup_defaults;
20pub mod test_defaults;
21pub mod tools;
22pub mod trait_bridge;
23pub mod update_defaults;
24pub mod validation;
25pub mod workspace;
26
27pub use derive::{derive_go_module_from_repo, derive_repo_org, derive_reverse_dns_package};
29pub use dto::{
30 CsharpDtoStyle, DtoConfig, ElixirDtoStyle, GoDtoStyle, JavaBuilderMode, JavaDtoConfig, JavaDtoStyle, NodeDtoStyle,
31 PhpDtoStyle, PythonDtoStyle, RDtoStyle, RubyDtoStyle,
32};
33pub use e2e::E2eConfig;
34pub use extras::{AdapterConfig, AdapterParam, AdapterPattern, Language, is_known_language};
35pub use languages::{
36 CSharpConfig, CapsuleTypeConfig, CustomModulesConfig, CustomRegistration, CustomRegistrationsConfig, DartConfig,
37 DartStyle, ElixirConfig, FfiConfig, FfiTargetDepOverride, GleamConfig, GleamElementConstructor, GleamElementField,
38 GoConfig, JavaConfig, JniConfig, KotlinAndroidConfig, KotlinConfig, KotlinFfiStyle, KotlinTarget,
39 NapiTypeTagConfig, NodeCapsuleTypeConfig, NodeConfig, PhpConfig, PythonConfig, RConfig, RubyConfig, StubsConfig,
40 SwiftConfig, WasmConfig, ZigConfig,
41};
42pub use legacy::{LegacyConfigError, LegacyKey, detect_legacy_keys};
43pub use new_config::{NewAlefConfig, ResolveError};
44pub use output::{
45 BuildCommandConfig, CitationAuthor, CitationConfig, CleanConfig, ExcludeConfig, GeneratedHeaderConfig,
46 IncludeConfig, LintConfig, OutputConfig, OutputTemplate, PrecommitConfig, ReadmeConfig, ScaffoldCargo,
47 ScaffoldCargoEnvValue, ScaffoldCargoTargets, ScaffoldConfig, SetupConfig, SyncConfig, TestConfig, TextReplacement,
48 UpdateConfig,
49};
50pub use publish::{PublishConfig, PublishLanguageConfig, VendorMode};
51pub use raw_crate::RawCrateConfig;
52pub use resolve_helpers::{detect_serde_available, resolve_output_dir};
53pub use resolved::ResolvedCrateConfig;
54pub use tools::{DEFAULT_RUST_DEV_TOOLS, LangContext, ToolsConfig, require_tool, require_tools};
55pub use trait_bridge::{BridgeBinding, TraitBridgeConfig};
56pub use workspace::WorkspaceConfig;
57
58#[derive(Debug, Clone, Serialize, Deserialize)]
60pub struct SourceCrate {
61 pub name: String,
63 pub sources: Vec<std::path::PathBuf>,
65}
66
67fn default_true() -> bool {
68 true
69}
70
71#[derive(Debug, Clone, Serialize, Deserialize)]
75pub struct GenerateConfig {
76 #[serde(default = "default_true")]
78 pub bindings: bool,
79 #[serde(default = "default_true")]
81 pub errors: bool,
82 #[serde(default = "default_true")]
84 pub configs: bool,
85 #[serde(default = "default_true")]
87 pub async_wrappers: bool,
88 #[serde(default = "default_true")]
90 pub type_conversions: bool,
91 #[serde(default = "default_true")]
93 pub package_metadata: bool,
94 #[serde(default = "default_true")]
96 pub public_api: bool,
97 #[serde(default = "default_true")]
100 pub reverse_conversions: bool,
101}
102
103impl Default for GenerateConfig {
104 fn default() -> Self {
105 Self {
106 bindings: true,
107 errors: true,
108 configs: true,
109 async_wrappers: true,
110 type_conversions: true,
111 package_metadata: true,
112 public_api: true,
113 reverse_conversions: true,
114 }
115 }
116}
117
118#[derive(Debug, Clone, Serialize, Deserialize)]
122pub struct FormatConfig {
123 #[serde(default = "default_true")]
127 pub enabled: bool,
128 #[serde(default)]
132 pub command: Option<String>,
133}
134
135impl Default for FormatConfig {
136 fn default() -> Self {
137 Self {
138 enabled: true,
139 command: None,
140 }
141 }
142}