Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Migrating from 0.24 to 0.25

See the release notes for what’s new. Most important changes first.

Rust

Documentation tooling

  • ThroughTypeInfo has new variants: Function { params, returns } (FunctionOf), Literal (ByName) and Data (a type deriving ScriptData, with a ScriptDataShape of Fields or Union). In the LAD file, structs are referred to by LadTypeKind::Fields and enums by LadTypeKind::Val.
  • LadFile::types holds LadTypes: LadType::Reference(Box<LadTypeDefinition>) for the types so far (serialized as before), and LadType::Data(LadDataType) for ScriptData types, whose LadDataShape is fields or a union of kinds. Use get_reference_type / reference_types where a LadTypeDefinition was expected.
  • New LadTypeKind::Function { params, returns } and LadTypeKind::Literal: implementations of ArgumentVisitor add visit_function and visit_literal.

Functions

  • Conversions moved from function to conversions: function::{from, into, from_ref, into_ref} are conversions::{from, into, from_ref, into_ref} (FromScript, IntoScript, V, R, M, Union, FromScriptErased, IntoScriptErased). The crate root re-exports are unchanged, i.e. bevy_mod_scripting_bindings::V.
  • ValueOf<M> is ValueOf<M, R = ReflectReference>: ValueOf<A> is unchanged, new and into_inner take and give the R.
  • GetFunctionInfo implementations provide function_info(name, namespace), which needs no value. get_function_info calls it.
  • Union<T1, T2> only tries the types which could convert the value, see FromScript::could_convert. When only T1 could, the error is T1’s rather than T2’s. Override could_convert in hand-written FromScript implementations to rule out the kinds of values they never convert.