1.2 KiB
Functions and Custom Types Metadata
{{#include ../../links.md}}
Exporting metadata requires the [`metadata`] feature.
Functions
The metadata of a [function] means all relevant information related to a function's definition including:
-
Its callable name
-
Its access mode (public or [private][
private
]) -
Its parameter names and types (if any)
-
Its return value and type (if any)
-
Its nature (i.e. native Rust or Rhai-scripted)
-
Its [namespace][function namespace] ([module] or global)
-
Its purpose, in the form of [doc-comments]
-
Usage notes, warnings, examples etc., in the form of [doc-comments]
A function's signature encapsulates the first four pieces of information in a single concise line of definition:
[private]
name(
param 1:
type 1,
param 2:
type 2,
...,
param n:
type n) ->
return type
Custom Types
The metadata of a [custom type] include:
-
Its full Rust type name
-
Its pretty-print display name (which can be the same as its Rust type name)
-
Its purpose, in the form of [doc-comments]