Skip to main content

Module bindings

Module bindings 

Source

Modules§

access_map
A map of access claims used to safely and dynamically access the world.
allocator
An allocator used to control the lifetime of allocations
conversions
Conversions from untyped reflected values to concrete values
docgen
Documentation generation for scripting languages.
error
Error types for the bindings
function
Abstractions to do with dynamic script functions
globals
Contains abstractions for exposing “globals” to scripts, in a language-agnostic way.
path
BMS native reflection paths
query
Utilities for querying the world.
reference
Motivation
reflection_extensions
Various utility functions for working with reflection types.
schedule
Dynamic scheduling from scripts
script_component
Everything necessary to support scripts registering their own components
script_value
This module contains the ScriptValue enum which is used to pass values between scripting languages and Rust.
type_data
Contains various Reflect type data we use in BMS.
world
Motivation

Macros§

downcast_into_value
Downcasts a reference into a value of a given type or returns an error if the downcast fails.
match_by_type
a utility for matching types by their std::any::TypeId

Structs§

AccessCount
A count of the number of readers and writers of an access claim.
AccessMap
A map of access claims
AllocatorDiagnosticPlugin
A plugin which registers various allocator diagnostics
AppReflectAllocator
Wrapper around a ReflectAllocator which can be freely copied and shared between threads
AppScheduleRegistry
A Send + Sync registry of bevy schedules.
AppScriptComponentRegistry
A registry of dynamically registered script components
AppScriptFunctionRegistry
Equivalent to AppScriptFunctionRegistry but stores functions with a more convenient signature for scripting to avoid boxing every argument.
AppScriptGlobalsRegistry
A send + sync wrapper around the ScriptGlobalsRegistry.
ClaimOwner
An owner of an access claim and the code location of the claim.
CoreScriptGlobalsPlugin
A plugin introducing core globals for the BMS framework.
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
DynamicComponent
A dynamic script component
DynamicComponentInfo
Some metadata about dynamic script components
DynamicScriptComponentPlugin
A plugin to support dynamic script components
DynamicScriptFunction
A dynamic script function.
DynamicScriptFunctionMut
A dynamic mutable script function.
ExternalError
An error that occurred in an external library.
FunctionArgInfo
Information about a function argument.
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
FunctionInfo
Information about a function.
FunctionKey
A key used to identify a function in the registry
FunctionReturnInfo
Information about a function return value.
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).
MarkAsCore
A marker type to indicate that a type is core to BMS.
MarkAsGenerated
A marker type to indicate that a type is generated.
MarkAsSignificant
A marker type to indicate that a type is significant.
Mut
A wrapper around a mutable reference to a value of type T.
NamespaceBuilder
A convenience builder for registering multiple functions in a namespace
OwningPtr
Pointer which owns the value it points to, and will deallocate it when dropped
Ref
A wrapper around a reference to a value of type T.
ReferencePath
A collection of references into a Reflect supporting trait object in series.
ReferencePathError
Errors to do with custom BMS reference path resolution.
ReflectAccessId
Describes the id pointing to the base value we are accessing via reflection, for components and resources this is the ComponentId for script owned values this is an allocationId, this is used to ensure we have permission to access the value.
ReflectAllocation
A boxed PartialReflect value
ReflectAllocationId
Unique identifier for an allocation
ReflectAllocator
Allocator used to allocate and deallocate dyn PartialReflect values Used to be able to ensure we have a “common root” for values allocated outside the world.
ReflectBaseType
The type id and base id of the value we want to access
ReflectRefIter
A generic iterator over any reflected value. Unlike a normal iterator, this one does not have a halting condition, it will keep returning elements forever. The iterator does not try to access the value, it just works out the next index/key to access. You will know you’ve reached the end when you get an error when trying to access the next element.
ReflectReference
A reference to an arbitrary reflected instance.
ReflectWrapper
A wrapper around a reflect value to implement various traits useful for error reporting.
ScheduleRegistry
A registry of bevy schedules.
ScriptComponentRegistration
A reference to a component type’s reflection registration.
ScriptComponentRegistry
A registry of dynamically registered script components
ScriptFunctionRegistry
A registry of dynamic script functions
ScriptFunctionRegistryArc
A thread-safe reference counted wrapper around a ScriptFunctionRegistry
ScriptGlobal
A global variable that can be exposed to scripts.
ScriptGlobalDummy
A dummy global variable that documents globals set via alternative ways.
ScriptGlobalsRegistry
A registry of global variables that can be exposed to scripts.
ScriptQueryBuilder
The query builder is used to build ECS queries which retrieve spefific components filtered by specific conditions.
ScriptQueryResult
A result from a query.
ScriptResourceRegistration
A reference to a resource type’s reflection registration.
ScriptTypeRegistration
A reference to a type which is not a Resource or Component.
SubsetAccessMap
An inverse of AccessMap, It limits the accesses allowed to be claimed to those in a pre-specified subset.
ThreadScriptContext
Context passed down indirectly to script related functions, used to avoid prop drilling problems.
ThreadWorldContainer
A world container that stores the world in a thread local
Union
A union of two or more (by nesting unions) types.
Val
A wrapper around a value of type T.
WorldAccessGuard
Provides safe access to the world via AnyAccessMap permissions, which enforce aliasing rules at runtime in multi-thread environments

Enums§

AnyAccessMap
A polymorphic enum for access map types.
InteropError
An error occurring when converting between rust and a script context.
IterationKey
The key of the current iteration
Namespace
A namespace for functions
Primitive
A coercion primitive used for intermediate normalizations.
ReferencePart
A key referencing into a Reflect supporting trait object.
ReflectAccessKind
Describes kinds of base value we are accessing via reflection
ReflectBase
The Id of the kind of reflection base being pointed to
ReflectionPrimitiveKind
A primitive type kind in the LAD file format.
ScriptOperatorNames
Main operator enum
ScriptValue
An abstraction of values that can be passed to and from scripts. This allows us to re-use logic between scripting languages.
ThroughTypeInfo
All Through types follow one rule:
TypeIdSource
Specifies where we should source the type id from when reflecting a ReflectReference
TypedWrapperKind
The kind of typed wrapper.
UntypedWrapperKind
The kind of untyped wrapper.

Constants§

ALLOCATOR_TOTAL_COLLECTED_DIAG_PATH
The path used for the total number of deallocated allocations diagnostic
ALLOCATOR_TOTAL_DIAG_PATH
The path used for the total number of allocations diagnostic

Traits§

AccessMapKey
For structs which can be mapped to a u64 index
ArgMeta
Describes an argument to a script function. Provides necessary information for the function to handle dispatch.
DisplayCodeLocation
A trait for displaying a code location nicely
DynamicSystemMeta
A trait for controlling system world access at runtime.
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.
GetFunctionInfo
for things you can call and provide some introspection capability.
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.
PartialReflectExt
Extension trait for PartialReflect providing additional functionality for working with specific types.
ReflectionPathExt
An iterator over a reflect reference that will keep returning the next element forever.
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.
TypeInfoExtensions
Extension trait for TypeInfos providing additional functionality for working with type information.
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.
TypedThrough
A trait for types that can be converted to a ThroughTypeInfo.

Functions§

as_reflect_primitive
Returns the primitive kind if the given type info corresponds to one
convert
Attempts to convert the value given by value into a suitable value of the target type.
garbage_collector
Cleans up dangling script allocations
into_through_type_info
A dynamic version of TypedThrough, which can be used to convert a TypeInfo into a ThroughTypeInfo.
measure_allocations
Measures the number of allocations in the allocator and other diagnostics when enabled

Type Aliases§

ScriptGlobalMakerFn
A function that creates a global variable.
WorldGuard
Prefer to directly using WorldAccessGuard. If the underlying type changes, this alias will be updated.
WorldGuardRef
Similar to WorldGuard, but without the arc, use for when you don’t need the outer Arc.