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, CustomModulesConfig, CustomRegistration, CustomRegistrationsConfig, DartConfig, DartStyle,
36 ElixirConfig, FfiConfig, GleamConfig, GoConfig, JavaConfig, KotlinConfig, KotlinTarget, NodeConfig, PhpConfig,
37 PythonConfig, RConfig, RubyConfig, StubsConfig, SwiftConfig, WasmConfig, ZigConfig,
38};
39pub use legacy::{LegacyConfigError, LegacyKey, detect_legacy_keys};
40pub use new_config::{NewAlefConfig, ResolveError};
41pub use output::{
42 BuildCommandConfig, CleanConfig, ExcludeConfig, IncludeConfig, LintConfig, OutputConfig, OutputTemplate,
43 ReadmeConfig, ScaffoldCargo, ScaffoldCargoEnvValue, ScaffoldCargoTargets, ScaffoldConfig, SetupConfig, SyncConfig,
44 TestConfig, TextReplacement, UpdateConfig,
45};
46pub use publish::{PublishConfig, PublishLanguageConfig, VendorMode};
47pub use raw_crate::RawCrateConfig;
48pub use resolve_helpers::{detect_serde_available, resolve_output_dir};
49pub use resolved::ResolvedCrateConfig;
50pub use tools::{DEFAULT_RUST_DEV_TOOLS, LangContext, ToolsConfig, require_tool, require_tools};
51pub use trait_bridge::{BridgeBinding, TraitBridgeConfig};
52pub use workspace::WorkspaceConfig;
53
54#[derive(Debug, Clone, Serialize, Deserialize)]
56pub struct SourceCrate {
57 pub name: String,
59 pub sources: Vec<std::path::PathBuf>,
61}
62
63fn default_true() -> bool {
64 true
65}
66
67#[derive(Debug, Clone, Serialize, Deserialize)]
71pub struct GenerateConfig {
72 #[serde(default = "default_true")]
74 pub bindings: bool,
75 #[serde(default = "default_true")]
77 pub errors: bool,
78 #[serde(default = "default_true")]
80 pub configs: bool,
81 #[serde(default = "default_true")]
83 pub async_wrappers: bool,
84 #[serde(default = "default_true")]
86 pub type_conversions: bool,
87 #[serde(default = "default_true")]
89 pub package_metadata: bool,
90 #[serde(default = "default_true")]
92 pub public_api: bool,
93 #[serde(default = "default_true")]
96 pub reverse_conversions: bool,
97}
98
99impl Default for GenerateConfig {
100 fn default() -> Self {
101 Self {
102 bindings: true,
103 errors: true,
104 configs: true,
105 async_wrappers: true,
106 type_conversions: true,
107 package_metadata: true,
108 public_api: true,
109 reverse_conversions: true,
110 }
111 }
112}
113
114#[derive(Debug, Clone, Serialize, Deserialize)]
118pub struct FormatConfig {
119 #[serde(default = "default_true")]
123 pub enabled: bool,
124 #[serde(default)]
128 pub command: Option<String>,
129}
130
131impl Default for FormatConfig {
132 fn default() -> Self {
133 Self {
134 enabled: true,
135 command: None,
136 }
137 }
138}