pub struct AlefConfig {Show 30 fields
pub crate_config: CrateConfig,
pub languages: Vec<Language>,
pub exclude: ExcludeConfig,
pub include: IncludeConfig,
pub output: OutputConfig,
pub python: Option<PythonConfig>,
pub node: Option<NodeConfig>,
pub ruby: Option<RubyConfig>,
pub php: Option<PhpConfig>,
pub elixir: Option<ElixirConfig>,
pub wasm: Option<WasmConfig>,
pub ffi: Option<FfiConfig>,
pub go: Option<GoConfig>,
pub java: Option<JavaConfig>,
pub csharp: Option<CSharpConfig>,
pub r: Option<RConfig>,
pub scaffold: Option<ScaffoldConfig>,
pub readme: Option<ReadmeConfig>,
pub lint: Option<HashMap<String, LintConfig>>,
pub test: Option<HashMap<String, TestConfig>>,
pub custom_files: Option<HashMap<String, Vec<PathBuf>>>,
pub adapters: Vec<AdapterConfig>,
pub custom_modules: CustomModulesConfig,
pub custom_registrations: CustomRegistrationsConfig,
pub sync: Option<SyncConfig>,
pub opaque_types: HashMap<String, String>,
pub generate: GenerateConfig,
pub generate_overrides: HashMap<String, GenerateConfig>,
pub dto: DtoConfig,
pub e2e: Option<E2eConfig>,
}Expand description
Root configuration from alef.toml.
Fields§
§crate_config: CrateConfig§languages: Vec<Language>§exclude: ExcludeConfig§include: IncludeConfig§output: OutputConfig§python: Option<PythonConfig>§node: Option<NodeConfig>§ruby: Option<RubyConfig>§php: Option<PhpConfig>§elixir: Option<ElixirConfig>§wasm: Option<WasmConfig>§ffi: Option<FfiConfig>§go: Option<GoConfig>§java: Option<JavaConfig>§csharp: Option<CSharpConfig>§r: Option<RConfig>§scaffold: Option<ScaffoldConfig>§readme: Option<ReadmeConfig>§lint: Option<HashMap<String, LintConfig>>§test: Option<HashMap<String, TestConfig>>§custom_files: Option<HashMap<String, Vec<PathBuf>>>§adapters: Vec<AdapterConfig>§custom_modules: CustomModulesConfig§custom_registrations: CustomRegistrationsConfig§sync: Option<SyncConfig>§opaque_types: HashMap<String, String>Declare opaque types from external crates that alef can’t extract. Map of type name → Rust path (e.g., “Tree” = “tree_sitter_language_pack::Tree”). These get opaque wrapper structs in all backends.
generate: GenerateConfigControls which generation passes alef runs (all default to true).
generate_overrides: HashMap<String, GenerateConfig>Per-language overrides for generate flags (key = language name, e.g., “python”).
dto: DtoConfigPer-language DTO/type generation style (dataclass vs TypedDict, zod vs interface, etc.).
e2e: Option<E2eConfig>E2E test generation configuration.
Implementations§
Source§impl AlefConfig
impl AlefConfig
Sourcepub fn features_for_language(&self, lang: Language) -> &[String]
pub fn features_for_language(&self, lang: Language) -> &[String]
Get the features to use for a specific language’s binding crate.
Checks for a per-language override first, then falls back to [crate] features.
Sourcepub fn core_import(&self) -> String
pub fn core_import(&self) -> String
Get the core crate import path (e.g., “liter_llm”). Used by codegen to call into the core crate.
Sourcepub fn ffi_prefix(&self) -> String
pub fn ffi_prefix(&self) -> String
Get the FFI prefix (e.g., “kreuzberg”). Used by FFI, Go, Java, C# backends.
Sourcepub fn ffi_lib_name(&self) -> String
pub fn ffi_lib_name(&self) -> String
Get the FFI native library name (for Go cgo, Java Panama, C# P/Invoke).
Resolution order:
[ffi] lib_nameexplicit override- Directory name of
output.ffipath with hyphens replaced by underscores (e.g.crates/html-to-markdown-ffi/src/→html_to_markdown_ffi) {ffi_prefix}_ffifallback
Sourcepub fn ffi_header_name(&self) -> String
pub fn ffi_header_name(&self) -> String
Get the FFI header name.
Sourcepub fn python_module_name(&self) -> String
pub fn python_module_name(&self) -> String
Get the Python module name.
Sourcepub fn node_package_name(&self) -> String
pub fn node_package_name(&self) -> String
Get the Node package name.
Sourcepub fn ruby_gem_name(&self) -> String
pub fn ruby_gem_name(&self) -> String
Get the Ruby gem name.
Sourcepub fn php_extension_name(&self) -> String
pub fn php_extension_name(&self) -> String
Get the PHP extension name.
Sourcepub fn elixir_app_name(&self) -> String
pub fn elixir_app_name(&self) -> String
Get the Elixir app name.
Sourcepub fn java_package(&self) -> String
pub fn java_package(&self) -> String
Get the Java package name.
Sourcepub fn java_group_id(&self) -> String
pub fn java_group_id(&self) -> String
Get the Java Maven groupId.
Uses the full Java package as the groupId, matching Maven convention where groupId equals the package declaration.
Sourcepub fn csharp_namespace(&self) -> String
pub fn csharp_namespace(&self) -> String
Get the C# namespace.
Sourcepub fn core_crate_dir(&self) -> String
pub fn core_crate_dir(&self) -> String
Get the directory name of the core crate (derived from sources or falling back to name).
For example, if sources contains "crates/html-to-markdown/src/lib.rs", this returns
"html-to-markdown". Used by the scaffold to generate correct path = "../../crates/…"
references in binding-crate Cargo.toml files.
Sourcepub fn r_package_name(&self) -> String
pub fn r_package_name(&self) -> String
Get the R package name.
Sourcepub fn resolved_version(&self) -> Option<String>
pub fn resolved_version(&self) -> Option<String>
Attempt to read the resolved version string from the configured version_from file.
Returns None if the file cannot be read or the version cannot be found.
Sourcepub fn serde_rename_all_for_language(&self, lang: Language) -> String
pub fn serde_rename_all_for_language(&self, lang: Language) -> String
Get the effective serde rename_all strategy for a given language.
Resolution order:
- Per-language config override (
[python] serde_rename_all = "...") - Language default:
- camelCase: node, wasm, java, csharp
- snake_case: python, ruby, php, go, ffi, elixir, r
Sourcepub fn rewrite_path(&self, rust_path: &str) -> String
pub fn rewrite_path(&self, rust_path: &str) -> String
Rewrite a rust_path using path_mappings. Matches the longest prefix first.
Trait Implementations§
Source§impl Clone for AlefConfig
impl Clone for AlefConfig
Source§fn clone(&self) -> AlefConfig
fn clone(&self) -> AlefConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more