pub struct CrateConfig {Show 13 fields
pub name: String,
pub sources: Vec<PathBuf>,
pub version_from: String,
pub core_import: Option<String>,
pub workspace_root: Option<PathBuf>,
pub skip_core_import: bool,
pub error_type: Option<String>,
pub error_constructor: Option<String>,
pub features: Vec<String>,
pub path_mappings: HashMap<String, String>,
pub extra_dependencies: HashMap<String, Value>,
pub auto_path_mappings: bool,
pub source_crates: Vec<SourceCrate>,
}Fields§
§name: String§sources: Vec<PathBuf>§version_from: String§core_import: Option<String>§workspace_root: Option<PathBuf>Optional workspace root path for resolving pub use re-exports from sibling crates.
skip_core_import: boolWhen true, skip adding use {core_import}; to generated bindings.
error_type: Option<String>The crate’s error type name (e.g., "KreuzbergError").
Used in trait bridge generation for error wrapping.
Defaults to "Error" if not set.
error_constructor: Option<String>Pattern for constructing error values from a String message in trait bridges.
{msg} is replaced with the format!(…) expression.
Example: "KreuzbergError::Plugin { message: {msg}, plugin_name: name.to_string() }"
Defaults to "{error_type}::from({msg})" if not set.
features: Vec<String>Cargo features that are enabled in binding crates.
Fields gated by #[cfg(feature = "...")] matching these features
are treated as always-present (cfg stripped from the IR).
path_mappings: HashMap<String, String>Maps extracted rust_path prefixes to actual import paths in binding crates. Example: { “spikard” = “spikard_http” } rewrites “spikard::ServerConfig” to “spikard_http::ServerConfig”
extra_dependencies: HashMap<String, Value>Additional Cargo dependencies added to ALL binding crate Cargo.tomls. Each entry is a crate name mapping to a TOML dependency spec (string for version-only, or inline table for path/features/etc.).
auto_path_mappings: boolWhen true (default), automatically derive path_mappings from source file locations.
For each source file matching crates/{name}/src/, adds a mapping from
{name} to the configured core_import.
source_crates: Vec<SourceCrate>Multi-crate source groups for workspaces with types spread across crates.
Each entry has a crate name and sources list. Types extracted from each
group get rust_path reflecting the actual defining crate, not the facade.
When non-empty, the top-level sources field is ignored.
Trait Implementations§
Source§impl Clone for CrateConfig
impl Clone for CrateConfig
Source§fn clone(&self) -> CrateConfig
fn clone(&self) -> CrateConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more