pub struct CallOverride {Show 16 fields
pub module: Option<String>,
pub function: Option<String>,
pub crate_name: Option<String>,
pub class: Option<String>,
pub alias: Option<String>,
pub header: Option<String>,
pub prefix: Option<String>,
pub options_type: Option<String>,
pub options_via: Option<String>,
pub enum_fields: HashMap<String, String>,
pub enum_module: Option<String>,
pub result_is_simple: bool,
pub handle_nested_types: HashMap<String, String>,
pub handle_dict_types: HashSet<String>,
pub handle_struct_type: Option<String>,
pub handle_atom_list_fields: HashSet<String>,
}Expand description
Per-language override for function call configuration.
Fields§
§module: Option<String>Override the module/import path.
function: Option<String>Override the function name.
crate_name: Option<String>Override the crate name (Rust only).
class: Option<String>Override the class name (Java/C# only).
alias: Option<String>Import alias (Go only, e.g., htmd).
header: Option<String>C header file name (C only).
prefix: Option<String>FFI symbol prefix (C only).
options_type: Option<String>For json_object args: the constructor to use instead of raw dict/object.
E.g., “ConversionOptions” — generates ConversionOptions(**options) in Python,
new ConversionOptions(options) in TypeScript.
options_via: Option<String>How to pass json_object args: “kwargs” (default), “dict”, or “json”.
"kwargs": constructOptionsType(key=val, ...)(requiresoptions_type)."dict": pass as a plain dict/object literal{"key": "val"}."json": pass viajson.loads('...')/JSON.parse('...').
enum_fields: HashMap<String, String>Maps fixture option field names to their enum type names.
E.g., {"headingStyle": "HeadingStyle", "codeBlockStyle": "CodeBlockStyle"}.
The generator imports these types and maps string values to enum constants.
enum_module: Option<String>Module to import enum types from (if different from the main module). E.g., “html_to_markdown._html_to_markdown” for PyO3 native enums.
result_is_simple: boolWhen true, the function returns a simple type (e.g., String) rather
than a struct. Generators that would normally emit result.content
(or equivalent field access) will use the result variable directly.
handle_nested_types: HashMap<String, String>Maps handle config field names to their Python type constructor names.
When the handle config object contains a nested dict-valued field, the
generator will wrap it in the specified type using keyword arguments.
E.g., {"browser": "BrowserConfig"} generates BrowserConfig(mode="auto")
instead of {"mode": "auto"}.
handle_dict_types: HashSet<String>Handle config fields whose type constructor takes a single dict argument instead of keyword arguments.
E.g., ["auth"] means AuthConfig({"type": "basic", ...}) instead of
AuthConfig(type="basic", ...).
handle_struct_type: Option<String>Elixir struct module name for the handle config argument.
When set, the generated Elixir handle config uses struct literal syntax
(%Module.StructType{key: val}) instead of a plain string-keyed map.
Rustler NifStruct requires a proper Elixir struct — plain maps are rejected.
E.g., "CrawlConfig" generates %Kreuzcrawl.CrawlConfig{download_assets: true}.
handle_atom_list_fields: HashSet<String>Handle config fields whose list values are Elixir atoms (Rustler NifUnitEnum).
When a config field is a Vec<EnumType> in Rust, the Elixir side must pass
a list of atoms (e.g., [:image, :document]) not strings (["image"]).
List the field names here so the generator emits atom literals instead of strings.
E.g., ["asset_types"] generates asset_types: [:image] instead of ["image"].
Trait Implementations§
Source§impl Clone for CallOverride
impl Clone for CallOverride
Source§fn clone(&self) -> CallOverride
fn clone(&self) -> CallOverride
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more