Skip to main content

CrateConfig

Struct CrateConfig 

Source
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: bool

When 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: bool

When 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

Source§

fn clone(&self) -> CrateConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CrateConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for CrateConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for CrateConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,