pub fn generate_as_coercion_trait_impls(parsed_impl: &ParsedImpl) -> TokenStreamExpand description
Generate impl As* trait impls for methods with #[miniextendr(as = "...")].
For each as coercion method, generates a forwarding trait impl:
ⓘ
impl ::miniextendr_api::as_coerce::AsDataFrame for MyType {
fn as_data_frame(&self) -> Result<::miniextendr_api::List, ::miniextendr_api::as_coerce::AsCoerceError> {
self.as_data_frame() // inherent method preferred over trait method
}
}Skips methods with extra parameters beyond &self (trait methods have fixed signatures)
and skips non-standard targets (like “tibble”, “data.table”) that don’t have corresponding traits.