pub fn gen_async_body(
core_call: &str,
cfg: &RustBindingConfig<'_>,
has_error: bool,
return_wrap: &str,
is_opaque: bool,
inner_clone_line: &str,
is_unit_return: bool,
) -> StringExpand description
Generate the body for an async call, unified across methods, static methods, and free functions.
-
core_call: the expression to await, e.g.inner.method(args)orCoreType::fn(args). For Pyo3FutureIntoPy opaque methods this should referenceinner(the Arc clone); for all other patterns it may referenceself.inneror a static call expression. -
cfg: binding configuration (determines which async pattern to emit) -
has_error: whether the core call returns aResult -
return_wrap: expression to produce the binding return value fromresult, e.g."result"or"TypeName::from(result)" -
is_opaque: whether the binding type is Arc-wrapped (affects TokioBlockOn wrapping) -
inner_clone_line: optional statement emitted before the pattern-specific body, e.g."let inner = self.inner.clone();\n "for opaque instance methods, or"". Required whencore_callreferencesinner(Pyo3FutureIntoPy opaque case).