Skip to main content

Module binding_helpers

Module binding_helpers 

Source

Functions§

gen_async_body
Generate the body for an async call, unified across methods, static methods, and free functions.
gen_call_args
Build call argument expressions from parameters.
gen_call_args_with_let_bindings
Build call argument expressions using pre-bound let bindings for non-opaque Named params. Non-opaque Named params use &{name}_core references instead of .into().
gen_lossy_binding_to_core_fields
Generate a lossy binding→core struct literal for non-opaque delegation. Sanitized fields use Default::default(), non-sanitized fields are cloned and converted. Fields are accessed via self. (behind &self), so all non-Copy types need .clone().
gen_lossy_binding_to_core_fields_mut
Same as gen_lossy_binding_to_core_fields but declares core_self as mutable.
gen_named_let_bindings_pub
Generate let bindings for non-opaque Named params, converting them to core types.
gen_serde_let_bindings
Generate serde-based let bindings for non-opaque Named params. Serializes binding types to JSON and deserializes to core types. Used when From impls don’t exist (e.g., types with sanitized fields). indent is the whitespace prefix for each generated line (e.g., “ “ for functions, “ “ for methods).
gen_unimplemented_body
Generate a compilable body for functions that can’t be auto-delegated. Returns a default value or error instead of todo!() which would panic.
has_named_params
Check if params contain any non-opaque Named types that need let bindings.
is_simple_non_opaque_param
Check if a param type is safe for non-opaque delegation (no complex conversions needed). Vec and Map params can cause type mismatches (e.g. Vec vs &&str).
wrap_return
Wrap a core-call result for opaque delegation methods.