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, "<nif>", ...) 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 = "sample_core.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 = "sample_core.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
impl Clone for GleamConfig
Source§fn clone(&self) -> GleamConfig
fn clone(&self) -> GleamConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GleamConfig
impl Debug for GleamConfig
Source§impl<'de> Deserialize<'de> for GleamConfig
impl<'de> Deserialize<'de> for GleamConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for GleamConfig
impl JsonSchema for GleamConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for GleamConfig
impl RefUnwindSafe for GleamConfig
impl Send for GleamConfig
impl Sync for GleamConfig
impl Unpin for GleamConfig
impl UnsafeUnpin for GleamConfig
impl UnwindSafe for GleamConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more