Skip to main content

GleamConfig

Struct GleamConfig 

Source
pub struct GleamConfig {
    pub app_name: Option<String>,
    pub nif_module: Option<String>,
    pub features: Option<Vec<String>>,
    pub serde_rename_all: Option<String>,
    pub rename_fields: HashMap<String, String>,
    pub exclude_functions: Vec<String>,
    pub exclude_types: Vec<String>,
    pub run_wrapper: Option<String>,
    pub extra_lint_paths: Vec<String>,
    pub element_constructors: Vec<GleamElementConstructor>,
    pub json_object_wrapper: Option<String>,
}

Fields§

§app_name: Option<String>§nif_module: Option<String>

Erlang atom name for @external(erlang, “”, …) lookups (e.g., “my_app_nif”). Defaults to the app_name.

§features: Option<Vec<String>>§serde_rename_all: Option<String>

Override the serde rename_all strategy for JSON field names (e.g. “camelCase”, “snake_case”). When set, this takes priority over the IR type-level serde_rename_all.

§rename_fields: HashMap<String, String>

Per-field name remapping for this language. Key is TypeName.field_name, value is the desired binding field name. Applied after automatic keyword escaping.

§exclude_functions: Vec<String>

Functions to exclude from Gleam binding generation.

§exclude_types: Vec<String>

Types to exclude from Gleam binding generation.

§run_wrapper: Option<String>

Prefix wrapper for default tool invocations.

§extra_lint_paths: Vec<String>

Extra paths to append to default lint commands.

§element_constructors: Vec<GleamElementConstructor>

Per-element_type Gleam record-constructor recipes used by the e2e generator when emitting json_object arg literals. Each entry maps a fixture-side element_type string (e.g. "BatchFileItem") to a structured constructor description that the codegen interpolates per JSON-array item. Without an entry the codegen falls back to the json_object_wrapper (or a plain json_to_gleam).

Example:

[[crates.gleam.element_constructors]]
element_type = "BatchFileItem"
constructor = "kreuzberg.BatchFileItem"
[[crates.gleam.element_constructors.fields]]
gleam_field = "path"
kind = "file_path"
json_field = "path"
[[crates.gleam.element_constructors.fields]]
gleam_field = "config"
kind = "literal"
value = "option.None"
§json_object_wrapper: Option<String>

Optional Gleam expression template used to wrap json_object arg values when no element_type recipe matches. The placeholder {json} is replaced with a Gleam string literal containing the JSON form of the arg value, allowing the downstream’s Gleam binding to do its own parsing.

Example:

[crates.gleam]
json_object_wrapper = "kreuzberg.config_from_json_string({json})"

When None, the codegen emits {json} verbatim (a plain Gleam string), matching the iter15 default.

Trait Implementations§

Source§

impl Clone for GleamConfig

Source§

fn clone(&self) -> GleamConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for GleamConfig

Source§

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

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

impl<'de> Deserialize<'de> for GleamConfig

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 GleamConfig

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>,