Skip to main content

Module vtable

Module vtable 

Source
Expand description

Vtable static generation, C wrapper generation, and method attribute parsing for trait impls.

This module contains the core codegen for #[miniextendr] on impl Trait for Type blocks. It produces the vtable static constant, C-callable wrapper functions for each method and associated constant, and delegates to super::r_wrappers for R wrapper code generation.

Structsยง

TraitMethodAttrs ๐Ÿ”’
Parsed #[miniextendr(...)] attributes for a single trait method.

Functionsยง

extract_consts ๐Ÿ”’
Extract associated constant items from a trait impl block.
extract_methods ๐Ÿ”’
Extract all methods from a trait impl block as TraitMethod structs.
generate_concrete_vtable_shims ๐Ÿ”’
Generate concrete vtable shims for a generic trait impl.
generate_trait_const_c_wrapper ๐Ÿ”’
Generate a C wrapper function and R_CallMethodDef for a trait associated constant.
generate_trait_method_c_wrapper ๐Ÿ”’
Generate a C wrapper function and R_CallMethodDef for a single trait method.
generate_vtable_static ๐Ÿ”’
Generate the vtable static, C wrappers, R wrappers, and call defs for a trait implementation.
is_self_ref_type ๐Ÿ”’
Check if a type is &Self or &mut Self.
output_is_result ๐Ÿ”’
Returns true when the return type is syntactically Result<_, _>.
parse_trait_method_attrs ๐Ÿ”’
Parse #[miniextendr(...)] attributes from a trait method.