Lookup table for normalized RustQ callable metadata.
The index stores RustQ.Binding.Callable values under local and target-qualified
call keys. Method callables are indexed both by their full Rust signature arity
and, when they include a receiver/self argument, by the Elixir-style call arity
that excludes the receiver. This lets lowering ask for Canvas.draw_rect(rect)
even when the Rust signature is draw_rect(&self, rect: Rect).
Summary
Functions
Returns expected argument types for a callable lookup.
Fetches a callable by optional target, function name, and call arity.
Returns a callable by optional target, function name, and call arity or nil.
Returns method receiver targets for a method name and Elixir-style call arity.
Builds a callable lookup index.
Adds a callable to the index under all lookup keys it supports.
Returns the return type for a callable lookup or nil when unknown/unit.
Types
@type key() :: {String.t() | nil, String.t(), non_neg_integer()}
@type t() :: %RustQ.Binding.Index{ by_key: %{optional(key()) => RustQ.Binding.Callable.t()} }
Functions
@spec argument_types( t(), String.t() | atom() | nil, String.t() | atom(), non_neg_integer() ) :: [RustQ.Meta.Type.t()] | nil
Returns expected argument types for a callable lookup.
@spec fetch(t(), String.t() | atom() | nil, String.t() | atom(), non_neg_integer()) :: {:ok, RustQ.Binding.Callable.t()} | :error
Fetches a callable by optional target, function name, and call arity.
@spec get(t(), String.t() | atom() | nil, String.t() | atom(), non_neg_integer()) :: RustQ.Binding.Callable.t() | nil
Returns a callable by optional target, function name, and call arity or nil.
@spec method_targets(t(), String.t() | atom(), non_neg_integer()) :: [String.t()]
Returns method receiver targets for a method name and Elixir-style call arity.
@spec new([RustQ.Binding.Callable.t()] | t() | nil) :: t()
Builds a callable lookup index.
@spec put(t(), RustQ.Binding.Callable.t()) :: t()
Adds a callable to the index under all lookup keys it supports.
@spec return_type( t(), String.t() | atom() | nil, String.t() | atom(), non_neg_integer() ) :: RustQ.Meta.Type.t() | nil
Returns the return type for a callable lookup or nil when unknown/unit.