Skip to main content

Module method_id

Module method_id 

Source
Expand description

Typed method identifiers for zero-cost dispatch.

MethodId(u16) replaces string-based method lookup at runtime. The compiler resolves method names to MethodId at compile time, and the VM dispatches on a u16 match instead of a PHF string lookup.

Methods not known at compile time use MethodId::DYNAMIC, which triggers a fallback to string-based lookup.

Structsยง

MethodId
A typed method identifier. Wraps a u16 discriminant that the compiler resolves from method name strings at compile time.