Module yarnspinner::core
source · Expand description
Core types and traits that are used by both the compiler and runtime.
Macros§
- Create a
Library
from a list of named functions.
Structs§
- A collection of functions that can be called from Yarn scripts.
- The unique ID of a line in a Yarn script. In a Yarn script, line IDs look like this:
- Represents a position in a multi-line string.
- Helper class for implementing something like
YarnFn
yourself. You probably don’t want to use this directly as a consumer unless you’re doing some wizardry.
Enums§
- All types in the virtual machine, both built-in, i.e. usable in Yarn scripts, and internal.
- Represents a Yarn value. The chosen variant corresponds to the last assignment of the value, with the type being inferred from the type checker.
- Represents a failure to convert one variant of
YarnValue
to a base type.
Traits§
- The return value of a [
YarnFn
]. See [YarnFn
] for more information on the kinds of signatures that can be registered. - A
YarnFn
with theMarker
type parameter erased. See its documentation for more information about what kind of functions are allowed. - A function that can be registered into and called from Yarn. It must have the following properties:
- Trait implemented by types that can be used in
YarnFn
-like contexts. Implemented by the following types and references of them:
Type Aliases§
- Shorthand way of accessing the associated type
YarnFnParam::Item
for a givenYarnFnParam
.