RustQ.NativeDescriptor (rustq v0.6.0)

Copy Markdown View Source

Resolved metadata for a RustQ.NativeRef.

A descriptor combines a native reference with parsed RustQ.Syn method metadata and, when available, a web source link derived from Cargo metadata.

Summary

Functions

Validates a descriptor's method argument/return shape.

Resolves a native method reference through a RustQ.Syn.Index.

Resolves a native method reference and validates its argument/return shape.

Types

expected_arg()

@type expected_arg() ::
  :self_ref
  | {:ref, String.t()}
  | {:impl_trait, String.t(), [String.t()]}
  | {:path, String.t()}
  | :any

expected_return()

@type expected_return() :: {:ref, String.t()} | {:path, String.t()} | :none | :any

t()

@type t() :: %RustQ.NativeDescriptor{
  method: RustQ.Syn.Method.t(),
  ref: RustQ.NativeRef.t(),
  source_url: String.t() | nil
}

Functions

assert_shape!(descriptor, opts)

@spec assert_shape!(
  t(),
  keyword()
) :: t()

Validates a descriptor's method argument/return shape.

resolve!(index, ref)

@spec resolve!(RustQ.Syn.Index.t(), RustQ.NativeRef.t()) :: t()

Resolves a native method reference through a RustQ.Syn.Index.

resolve!(index, ref, opts)

@spec resolve!(RustQ.Syn.Index.t(), RustQ.NativeRef.t(), keyword()) :: t()

Resolves a native method reference and validates its argument/return shape.