Skip to content

[FEAT][RUST] Resolve reflected type methods and constructors from Rust - #707

Merged
tqchen merged 1 commit into
apache:mainfrom
Seven-Streams:feat/rust-reflected-method-lookup
Aug 12, 2026
Merged

[FEAT][RUST] Resolve reflected type methods and constructors from Rust#707
tqchen merged 1 commit into
apache:mainfrom
Seven-Streams:feat/rust-reflected-method-lookup

Conversation

@Seven-Streams

Copy link
Copy Markdown
Contributor

Add Function::from_type_method(type_index, name) and Function::from_type_key_method(type_key, name) to look up methods registered through the C++ reflection registry (efl::ObjectDef<T>::def(...)), which live in the per-type method table rather than the global function table. Constructors registered via refl::init are reachable under the reserved name ffi_init.

Downstream Rust consumers of libraries that follow the ObjectDef idiom previously had to hand-roll this table walk against raw tvm-ffi-sys structs; this provides the missing primitive in the crate itself.

Add Function::from_type_method(type_index, name) and
Function::from_type_key_method(type_key, name) to look up methods
registered through the C++ reflection registry
(refl::ObjectDef<T>::def(...)), which live in the per-type method
table rather than the global function table. Constructors registered
via refl::init are reachable under the reserved name __ffi_init__.

Downstream Rust consumers of libraries that follow the ObjectDef idiom
previously had to hand-roll this table walk against raw tvm-ffi-sys
structs; this provides the missing primitive in the crate itself.

Signed-off-by: yuchuan <yuchuan.7streams@gmail.com>
@Seven-Streams
Seven-Streams force-pushed the feat/rust-reflected-method-lookup branch from ddb9021 to 9d484de Compare August 11, 2026 23:58
@tqchen
tqchen merged commit 75e693f into apache:main Aug 12, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants