Module function

Module function 

Source
Expand description

Abstractions to do with dynamic script functions

Modules§

arg_meta
Trait implementations to help with function dispatch.
from
This module contains the FromScript trait and its implemenations.
from_ref
Contains the FromScriptRef trait and its implementations.
into
Implementations of the IntoScript trait for various types.
into_ref
Contains the IntoScriptRef trait and its implementations.
magic_functions
All the switchable special functions used by language implementors
namespace
A module for managing namespaces for functions
script_function
Implementations of the ScriptFunction and ScriptFunctionMut traits for functions with up to 13 arguments.
type_dependencies
This module contains the GetTypeDependencies trait and its implementations for various types.

Macros§

match_by_type
a utility for matching types by their std::any::TypeId

Structs§

AppScriptFunctionRegistry
Equivalent to AppScriptFunctionRegistry but stores functions with a more convenient signature for scripting to avoid boxing every argument.
DummyScriptFunctionRegistry
Identical to the AppScriptFunctionRegistry, but the functions only exist for docs purposes, use if you provide functions at a lower level, but still want to include the function in the docs
DynamicScriptFunction
A dynamic script function.
DynamicScriptFunctionMut
A dynamic mutable script function.
FunctionCallContext
The caller context when calling a script function. Functions can choose to react to caller preferences such as converting 1-indexed numbers to 0-indexed numbers
FunctionKey
A key used to identify a function in the registry
GlobalNamespace
A type which implements IntoNamespace by always converting to the global namespace
LocationContext
Describes a location within a script
MagicFunctions
A list of magic methods, these only have one replacable implementation, and apply to all ReflectReferences. It’s up to the language implementer to call these in the right order (after any type specific overrides).
Mut
A wrapper around a mutable reference to a value of type T.
NamespaceBuilder
A convenience builder for registering multiple functions in a namespace
Ref
A wrapper around a reference to a value of type T.
ScriptFunctionRegistry
A registry of dynamic script functions
ScriptFunctionRegistryArc
A thread-safe reference counted wrapper around a ScriptFunctionRegistry
Union
A union of two or more (by nesting unions) types.
Val
A wrapper around a value of type T.

Enums§

Namespace
A namespace for functions

Traits§

ArgMeta
Describes an argument to a script function. Provides necessary information for the function to handle dispatch.
FromScript
Describes the procedure for constructing a value of type T from a ScriptValue.
FromScriptRef
Converts from a ScriptValue to a value equivalent to the given TypeId.
GetFunctionTypeDependencies
A trait collecting type dependency information for a whole function. Used to register everything used by a function with the type registry
GetTypeDependencies
Functionally identical to GetTypeRegistration but without the ’static bound
IntoNamespace
A type convertible to a Namespace
IntoScript
Converts a value into a ScriptValue.
IntoScriptRef
Converts a value represented by a reference into a crate::ScriptValue. Instead of a direct conversion, the trait tries to peek into the value behind the reference and find out the most suitable representation.
ScriptArgument
Marker trait for types that can be used as arguments to a script function.
ScriptFunction
A trait implemented by functions which can act as dynamic script functions, which can then be registered against a ScriptFunctionRegistry.
ScriptFunctionMut
A trait implemented by functions which can act as mutable dynamic script functions.
ScriptReturn
Marker trait for types that can be used as return values from a script function.
TypedScriptArgument
Marker trait for types that can be used as arguments to a script function. And contain type information.
TypedScriptReturn
Marker trait for types that can be used as return values from a script function. And contain type information.