RustQ.Meta.Lower.Paths (rustq v1.0.0-rc.19)

Copy Markdown View Source

The Rust paths Elixir aliases name, and the callables a path or a receiver's type reaches.

An alias a defrustmod maps is that Rust module, with what follows it; an alias ending in a plural, as Atoms, is a Rust module in snake case; any other is a Rust type or module as written. A call through a path or on a receiver finds its signature among the callables RustQ knows, trying the targets the path may name.

Summary

Functions

Whether ast is an alias.

The Rust path an alias names; see the module docs.

Whether ast is an alias or a field path through one, as Kinds.FANCY.

The Rust path an alias or field path through one names.

The ways to split alias parts into a prefix and the rest, longest prefix first.

The argument types of the callable function/arity on target (nil for a function), from the callables RustQ knows.

The return type of a local or remote call, from the callable metadata the :callables option supplies, which tells lowering when a call returning Result, Option, or NifResult lowers with Rust ?.

The callable target, as a Rust type name, a receiver of type calls methods on.

Whether alias parts end in an upper-case segment, as a constant such as Kind.PLAIN.

The Rust path alias parts name, through the longest defrustmod mapping of a prefix.

The argument types of a function Super.function names, in the module's parent.

The argument types of a function a Rust path names, trying each target the path may mean.

Whether ast is an alias RustQ reserves for building Rust AST, as Stmt.

Whether ast is Super, the Rust parent module.

The type a callable target names.

Functions

alias_ast?(arg1)

Whether ast is an alias.

alias_parts(arg, rust_modules)

The Rust path an alias names; see the module docs.

alias_path_ast?(arg1)

Whether ast is an alias or a field path through one, as Kinds.FANCY.

alias_path_parts(ast, rust_modules)

The Rust path an alias or field path through one names.

alias_prefixes(parts)

The ways to split alias parts into a prefix and the rest, longest prefix first.

callable_argument_types(target, function, arity, arity)

The argument types of the callable function/arity on target (nil for a function), from the callables RustQ knows.

callable_return_type(call_ast, opts \\ [])

@spec callable_return_type(
  Macro.t(),
  keyword()
) :: RustQ.Meta.Type.t() | nil

The return type of a local or remote call, from the callable metadata the :callables option supplies, which tells lowering when a call returning Result, Option, or NifResult lowers with Rust ?.

callable_target_from_type(type)

The callable target, as a Rust type name, a receiver of type calls methods on.

constant_alias?(parts)

Whether alias parts end in an upper-case segment, as a constant such as Kind.PLAIN.

mapped_alias_parts(parts, rust_modules)

The Rust path alias parts name, through the longest defrustmod mapping of a prefix.

parent_module_callable_argument_types(arg1, function, arity, callables)

The argument types of a function Super.function names, in the module's parent.

path_callable_argument_types(path, function, arity, context)

The argument types of a function a Rust path names, trying each target the path may mean.

path_callable_argument_types(path, function, arity, callables, rust_modules)

rust_constructor_alias?(arg1)

Whether ast is an alias RustQ reserves for building Rust AST, as Stmt.

super_alias_ast?(arg1)

Whether ast is Super, the Rust parent module.

type_for_callable_target(target)

The type a callable target names.