Bevy Public Unsafe APIs

Generated from workspace: bevy.

IndexModule PathAPI NameKindSafety Doc Mark
1bevy_asset::reflect::ReflectAssetget_unchecked_mutfunctionThis method does not prevent you from having two mutable pointers to the same data, violating Rust's aliasing rules. To avoid this: * Only call this method if you know that the [`UnsafeWorldCell`] may be used to access the corresponding `Assets<T>` * Don't call this method more than once in the same scope.
2bevy_ecs::bundleBundletraitManual implementations of this trait are unsupported. That is, there is no safe way to implement this trait, and you must not do so. If you want a type to implement [`Bundle`], you must use [`derive@Bundle`](derive@Bundle). [`Component`]: crate::component::Component [`Query`]: crate::system::Query
3bevy_ecs::bundleBundleFromComponentstraitManual implementations of this trait are unsupported. That is, there is no safe way to implement this trait, and you must not do so. If you want a type to implement [`Bundle`], you must use [`derive@Bundle`](derive@Bundle). [`Query`]: crate::system::Query
4bevy_ecs::bundle::writer::BundleScratchmanual_dropfunction`components` must be from the same world as the components that were pushed to this writer.
5bevy_ecs::bundle::writer::BundleWriterpush_componentfunction`components` must be from the same world that all previous [`Self::push_component`] calls were called with, and the _next_ [`Self::write`] call.
6bevy_ecs::bundle::writer::BundleWriterpush_component_by_idfunction`components` must be from the same world that all previous [`Self::push_component`] calls were called with, and the _next_ [`Self::write`] call. `component` must point to a [`Component`] value that matches `id`. `layout` must correspond to the layout of the [`Component`] type.
7bevy_ecs::bundle::writer::BundleWriterwritefunction`entity` must be from the same world that all [`Self::push_component`] calls since the last [`Self::write`] were called with.
8bevy_ecs::change_detection::params::MutUntypedwith_typefunction- `T` must be the erased pointee type for this [`MutUntyped`].
9bevy_ecs::component::info::ComponentDescriptornew_with_layoutfunction- the `drop` fn must be usable on a pointer with a value of the layout `layout` - the component type must be safe to access from any thread (Send + Sync in rust terms) - `relationship_accessor` must be valid for this component type if not `None`
10bevy_ecs::component::info::Componentsget_info_uncheckedfunction`id` must be a valid and fully registered [`ComponentId`].
11bevy_ecs::component::register::ComponentsQueuedRegistratornewfunctionThe [`Components`] and [`ComponentIds`] must match. For example, they must be from the same world.
12bevy_ecs::component::register::ComponentsRegistratornewfunctionThe [`Components`] and [`ComponentIds`] must match. For example, they must be from the same world.
13bevy_ecs::component::required::RequiredComponentConstructornewfunction- `component_id` must be a valid component for type `C`.
14bevy_ecs::component::required::RequiredComponentsRegistratorregister_required_by_idfunction`component_id` must be a valid [`ComponentId`] for `C` in the [`Components`] instance of `self`.
15bevy_ecs::component::required::RequiredComponentsRegistratorregister_required_dynamic_withfunction- `component_id` must be valid in the [`Components`] instance of `self`; - `constructor` must return a [`RequiredComponentConstructor`] that constructs a valid instance for the component with ID `component_id`.
16bevy_ecs::entity::clone_entities::ComponentCloneCtxwrite_target_component_ptrfunctionCaller must ensure that the passed in `ptr` references data that corresponds to the type of the source / target [`ComponentId`]. `ptr` must also contain data that the written component can "own" (for example, this should not directly copy non-Copy data).
17bevy_ecs::entity::entity_setEntityEquivalenttraitAny [`PartialEq`], [`Eq`], [`PartialOrd`], and [`Ord`] impls must evaluate the same for `Self` and its underlying entity. `x.entity() == y.entity()` must be equivalent to `x == y`. The above equivalence must also hold through and between calls to any [`Clone`] and [`Borrow`]/[`BorrowMut`] impls in place of [`entity()`]. The result of [`entity()`] must be unaffected by any interior mutability. The aforementioned properties imply determinism in both [`entity()`] calls and comparison trait behavior. All [`Hash`] impls except that for [`Entity`] must delegate to the [`Hash`] impl of another [`EntityEquivalent`] type. All conversions to the delegatee within the [`Hash`] impl must follow [`entity()`] equivalence. It should be noted that [`Hash`] is *not* a comparison trait, and with [`Hash::hash`] being forcibly generic over all [`Hasher`]s, **cannot** guarantee determinism or uniqueness of any final hash values on its own. To obtain hash values forming the same total order as [`Entity`], any [`Hasher`] used must be deterministic and concerning [`Entity`], collisionless. Standard library hash collections handle collisions with an [`Eq`] fallback, but do not account for determinism when [`BuildHasher`] is unspecified,. [`Hash`]: core::hash::Hash [`Hasher`]: core::hash::Hasher [`Borrow`]: core::borrow::Borrow [`BorrowMut`]: core::borrow::BorrowMut [`entity()`]: ContainsEntity::entity
18bevy_ecs::entity::entity_setEntitySetIteratortrait`x != y` must hold for any 2 elements returned by the iterator. This is always true for iterators that cannot return more than one element.
19bevy_ecs::entity::entity_set::UniqueEntityIteras_mut_innerfunction`self` must always contain an iterator that yields unique elements, even while this reference is live.
20bevy_ecs::entity::entity_set::UniqueEntityIterfrom_iterator_uncheckedfunction`iter` must only yield unique elements. As in, the resulting iterator must adhere to the safety contract of [`EntitySetIterator`].
21bevy_ecs::entity::index_map::Slicefrom_boxed_slice_uncheckedfunction`slice` must stem from an [`IndexMap`] using [`EntityHash`]. [`entity::index_map::Slice`]: `crate::entity::index_map::Slice`
22bevy_ecs::entity::index_map::Slicefrom_slice_uncheckedfunction`slice` must stem from an [`IndexMap`] using [`EntityHash`]. [`entity::index_map::Slice`]: `crate::entity::index_map::Slice`
23bevy_ecs::entity::index_map::Slicefrom_slice_unchecked_mutfunction`slice` must stem from an [`IndexMap`] using [`EntityHash`]. [`entity::index_map::Slice`]: `crate::entity::index_map::Slice`
24bevy_ecs::entity::index_set::Slicefrom_boxed_slice_uncheckedfunction`slice` must stem from an [`IndexSet`] using [`EntityHash`]. [`entity::index_set::Slice`]: `crate::entity::index_set::Slice`
25bevy_ecs::entity::index_set::Slicefrom_slice_uncheckedfunction`slice` must stem from an [`IndexSet`] using [`EntityHash`]. [`entity::index_set::Slice`]: `crate::entity::index_set::Slice`
26bevy_ecs::entity::index_set::Slicefrom_slice_unchecked_mutfunction`slice` must stem from an [`IndexSet`] using [`EntityHash`]. [`entity::index_set::Slice`]: `crate::entity::index_set::Slice`
27bevy_ecs::entity::unique_array::UniqueEntityEquivalentArrayfrom_arc_array_uncheckedfunction`slice` must contain only unique elements.
28bevy_ecs::entity::unique_array::UniqueEntityEquivalentArrayfrom_array_ref_uncheckedfunction`array` must contain only unique elements.
29bevy_ecs::entity::unique_array::UniqueEntityEquivalentArrayfrom_array_uncheckedfunction`array` must contain only unique elements.
30bevy_ecs::entity::unique_array::UniqueEntityEquivalentArrayfrom_boxed_array_uncheckedfunction`array` must contain only unique elements.
31bevy_ecs::entity::unique_array::UniqueEntityEquivalentArrayfrom_rc_array_uncheckedfunction`slice` must contain only unique elements.
32bevy_ecs::entity::unique_slicecast_slice_of_mut_unique_entity_slice_mutfunctionAll elements in each of the cast slices must be unique.
33bevy_ecs::entity::unique_slicecast_slice_of_unique_entity_slicefunctionAll elements in each of the cast slices must be unique.
34bevy_ecs::entity::unique_slicecast_slice_of_unique_entity_slice_mutfunctionAll elements in each of the cast slices must be unique.
35bevy_ecs::entity::unique_slicefrom_raw_partsfunction[`slice::from_raw_parts`] must be safe to call with `data` and `len`. Additionally, all elements in the resulting slice must be unique.
36bevy_ecs::entity::unique_slicefrom_raw_parts_mutfunction[`slice::from_raw_parts_mut`] must be safe to call with `data` and `len`. Additionally, all elements in the resulting slice must be unique.
37bevy_ecs::entity::unique_slice::UniqueEntityEquivalentSlicefrom_arc_slice_uncheckedfunction`slice` must contain only unique elements.
38bevy_ecs::entity::unique_slice::UniqueEntityEquivalentSlicefrom_boxed_slice_uncheckedfunction`slice` must contain only unique elements.
39bevy_ecs::entity::unique_slice::UniqueEntityEquivalentSlicefrom_rc_slice_uncheckedfunction`slice` must contain only unique elements.
40bevy_ecs::entity::unique_slice::UniqueEntityEquivalentSlicefrom_slice_uncheckedfunction`slice` must contain only unique elements.
41bevy_ecs::entity::unique_slice::UniqueEntityEquivalentSlicefrom_slice_unchecked_mutfunction`slice` must contain only unique elements.
42bevy_ecs::entity::unique_slice::UniqueEntityEquivalentSliceget_uncheckedfunction`index` must be safe to use with [`[T]::get_unchecked`] [`[T]::get_unchecked`]: `slice::get_unchecked`
43bevy_ecs::entity::unique_slice::UniqueEntityEquivalentSliceget_unchecked_mutfunction`index` must be safe to use with [`[T]::get_unchecked_mut`] [`[T]::get_unchecked_mut`]: `slice::get_unchecked_mut`
44bevy_ecs::entity::unique_slice::UniqueEntityEquivalentSlicesplit_at_mut_uncheckedfunction`mid` must be safe to use in [`[T]::split_at_mut_unchecked`]. [`[T]::split_at_mut_unchecked`]: `slice::split_at_mut_unchecked`
45bevy_ecs::entity::unique_slice::UniqueEntityEquivalentSlicesplit_at_uncheckedfunction`mid` must be safe to use in [`[T]::split_at_unchecked`]. [`[T]::split_at_unchecked`]: `slice::split_at_unchecked`
46bevy_ecs::entity::unique_slice::UniqueEntityEquivalentSliceIteras_mut_innerfunction`self` must always contain an iterator that yields unique elements, even while this reference is live.
47bevy_ecs::entity::unique_slice::UniqueEntityEquivalentSliceIterfrom_slice_iterator_uncheckedfunctionAll elements in each of the slices must be unique.
48bevy_ecs::entity::unique_slice::UniqueEntityEquivalentSliceIterMutas_mut_innerfunction`self` must always contain an iterator that yields unique elements, even while this reference is live.
49bevy_ecs::entity::unique_slice::UniqueEntityEquivalentSliceIterMutfrom_mut_slice_iterator_uncheckedfunctionAll elements in each of the slices must be unique.
50bevy_ecs::entity::unique_vec::UniqueEntityEquivalentVecappendfunction`other` must contain no elements that equal any element in `self`.
51bevy_ecs::entity::unique_vec::UniqueEntityEquivalentVecas_mut_vecfunctionThe elements of this `Vec` must always remain unique, even while this mutable reference is live.
52bevy_ecs::entity::unique_vec::UniqueEntityEquivalentVecdedup_byfunction`self` must only contain unique elements after each individual execution of `same_bucket`.
53bevy_ecs::entity::unique_vec::UniqueEntityEquivalentVecdedup_by_keyfunction`self` must only contain unique elements after each individual execution of `key`.
54bevy_ecs::entity::unique_vec::UniqueEntityEquivalentVecfrom_raw_partsfunctionIt must be safe to call [`Vec::from_raw_parts`] with these inputs, and the resulting [`Vec`] must only contain unique elements.
55bevy_ecs::entity::unique_vec::UniqueEntityEquivalentVecfrom_vec_uncheckedfunction`vec` must contain only unique elements.
56bevy_ecs::entity::unique_vec::UniqueEntityEquivalentVecinsertfunctionNo `T` contained by `self` may equal `element`.
57bevy_ecs::entity::unique_vec::UniqueEntityEquivalentVecpushfunctionNo `T` contained by `self` may equal `element`.
58bevy_ecs::entity::unique_vec::UniqueEntityEquivalentVecresize_withfunction`f` must only produce unique `T`, and none of these may equal any `T` in `self`.
59bevy_ecs::entity::unique_vec::UniqueEntityEquivalentVecretain_mutfunction`self` must only contain unique elements after each individual execution of `f`.
60bevy_ecs::entity::unique_vec::UniqueEntityEquivalentVecset_lenfunctionIt must be safe to call [`Vec::set_len`] with these inputs, and the resulting [`Vec`] must only contain unique elements.
61bevy_ecs::entity::unique_vec::UniqueEntityEquivalentVecsplicefunction`replace_with` must not yield any elements that equal any elements in `self`, except for those in `range`.
62bevy_ecs::event::triggerTriggertraitImplementing this properly is _advanced_ soundness territory! Implementers must abide by the following: - The `E`' [`Event::Trigger`] must be constrained to the implemented [`Trigger`] type, as part of the implementation. This prevents other [`Trigger`] implementations from directly deferring to your implementation, which is a very easy soundness misstep, as most [`Trigger`] implementations will invoke observers that are developed _for their specific [`Trigger`] type_. Without this constraint, something like [`GlobalTrigger`] could be called for _any_ [`Event`] type, even one that expects a different [`Trigger`] type. This would result in an unsound cast of [`GlobalTrigger`] reference. This is not expressed as an explicit type constraint,, as the `for<'a> Event::Trigger<'a>` lifetime can mismatch explicit lifetimes in some impls.
63bevy_ecs::event::triggertrigger_entity_internalfunction- `observers` must come from the `world` [`DeferredWorld`], and correspond to observers that match the `event` type - `event` must point to an [`Event`] - `trigger` must correspond to the [`Event::Trigger`] type expected by the `event` - `trigger_context`'s [`TriggerContext::event_key`] must correspond to the `event` type. - Read, understand, and abide by the [`Trigger`] safety documentation
64bevy_ecs::observer::distributed_storage::Observerwith_event_keyfunctionThe type of the `event_key` [`EventKey`] _must_ match the actual value of the event passed into the observer system.
65bevy_ecs::observer::distributed_storage::ObserverDescriptorwith_event_keysfunctionThe type of each [`EventKey`] in `event_keys` _must_ match the actual value of the event passed into the observer.
66bevy_ecs::query::fetchIterQueryDatatraitThis [`QueryData`] must not perform conflicting access when fetched for different entities.
67bevy_ecs::query::fetchQueryDatatrait- Component access of `Self::ReadOnly` must be a subset of `Self` and `Self::ReadOnly` must match exactly the same archetypes/tables as `Self` - `IS_READ_ONLY` must be `true` if and only if `Self: ReadOnlyQueryData` [`ReadOnly`]: Self::ReadOnly
68bevy_ecs::query::fetchReadOnlyQueryDatatraitThis must only be implemented for read-only [`QueryData`]'s.
69bevy_ecs::query::fetchSingleEntityQueryDatatraitThis [`QueryData`] must only access data from the current entity, and not any other entities.
70bevy_ecs::query::filterQueryFiltertraitThe [`WorldQuery`] implementation must not take any mutable access. This is the same safety requirement as [`ReadOnlyQueryData`](crate::query::ReadOnlyQueryData).
71bevy_ecs::query::state::QueryStateget_uncheckedfunctionThis does not check for mutable query correctness. To be safe, make sure mutable queries have unique access to the components they query.
72bevy_ecs::query::state::QueryStateiter_combinations_uncheckedfunctionThis does not check for mutable query correctness. To be safe, make sure mutable queries have unique access to the components they query.
73bevy_ecs::query::state::QueryStateiter_uncheckedfunctionThis does not check for mutable query correctness. To be safe, make sure mutable queries have unique access to the components they query.
74bevy_ecs::query::state::QueryStatenew_archetypefunction`archetype` must be from the `World` this state was initialized from.
75bevy_ecs::query::state::QueryStatenew_uncheckedfunctionIf the query is not read-only, then before calling any other methods on the returned `QueryState` other than [`QueryState::update_archetypes`], [`QueryState::update_archetypes_unsafe_world_cell`], [`Self::init_access`] must be called.
76bevy_ecs::query::state::QueryStatequery_uncheckedfunctionThis does not check for mutable query correctness. To be safe, make sure mutable queries have unique access to the components they query.
77bevy_ecs::query::state::QueryStatequery_unchecked_manualfunctionThis does not check for mutable query correctness. To be safe, make sure mutable queries have unique access to the components they query. This does not validate that `world.id()` matches `self.world_id`. Calling this on a `world` with a mismatched [`WorldId`] is unsound.
78bevy_ecs::query::state::QueryStatequery_unchecked_manual_with_ticksfunctionThis does not check for mutable query correctness. To be safe, make sure mutable queries have unique access to the components they query. This does not validate that `world.id()` matches `self.world_id`. Calling this on a `world` with a mismatched [`WorldId`] is unsound.
79bevy_ecs::query::state::QueryStatequery_unchecked_with_ticksfunctionThis does not check for mutable query correctness. To be safe, make sure mutable queries have unique access to the components they query.
80bevy_ecs::query::state::QueryStatesingle_uncheckedfunctionThis does not check for mutable query correctness. To be safe, make sure mutable queries have unique access to the components they query.
81bevy_ecs::query::state::QueryStatesingle_unchecked_manualfunctionThis does not check for mutable query correctness. To be safe, make sure mutable queries have unique access to the components they query. This does not validate that `world.id()` matches `self.world_id`. Calling this on a `world` with a mismatched [`WorldId`] is unsound.
82bevy_ecs::query::world_queryWorldQuerytraitImplementor must ensure that [`update_component_access`], [`QueryData::provide_extra_access`], [`matches_component_set`], [`QueryData::fetch`], [`QueryFilter::filter_fetch`] and [`init_fetch`] obey the following: - For each component mutably accessed by [`QueryData::fetch`], [`update_component_access`] or [`QueryData::provide_extra_access`] should add write access unless read or write access has already been added, in which case it should panic. - For each component readonly accessed by [`QueryData::fetch`] or [`QueryFilter::filter_fetch`], [`update_component_access`] or [`QueryData::provide_extra_access`] should add read access unless write access has already been added, in which case it should panic. - If `fetch` mutably accesses the same component twice, [`update_component_access`] should panic. - [`update_component_access`] may not add a `Without` filter for a component unless [`matches_component_set`] always returns `false` when the component set contains that component. - [`update_component_access`] may not add a `With` filter for a component unless [`matches_component_set`] always returns `false` when the component set doesn't contain that component. - In cases where the query represents a disjunction (such as an `Or` filter) where each element is a valid [`WorldQuery`], the following rules must be obeyed: - [`matches_component_set`] must be a disjunction of the element's implementations - [`update_component_access`] must replace the filters with a disjunction of filters - Each filter in that disjunction must be a conjunction of the corresponding element's filter with the previous `access` - For each resource readonly accessed by [`init_fetch`], [`update_component_access`] should add read access. - Mutable resource access is not allowed. - Any access added during [`QueryData::provide_extra_access`] must be a subset of `available_access`, and must not conflict with any access in `access`. When implementing [`update_component_access`], note that `add_read` and `add_write` both also add a `With` filter, whereas `extend_access` does not change the filters. [`QueryData::provide_extra_access`]: crate::query::QueryData::provide_extra_access [`QueryData::fetch`]: crate::query::QueryData::fetch [`QueryFilter::filter_fetch`]: crate::query::QueryFilter::filter_fetch [`init_fetch`]: Self::init_fetch [`matches_component_set`]: Self::matches_component_set [`Query`]: crate::system::Query [`update_component_access`]: Self::update_component_access [`QueryData`]: crate::query::QueryData [`QueryFilter`]: crate::query::QueryFilter
83bevy_ecs::reflect::component::ReflectComponentreflect_unchecked_mutfunctionThis method does not prevent you from having two mutable pointers to the same data, violating Rust's aliasing rules. To avoid this: * Only call this method with a [`UnsafeEntityCell`] that may be used to mutably access the component on the entity `entity` * Don't call this method more than once in the same scope for a given [`Component`].
84bevy_ecs::relationship::ComponentRelationshipAccessorrelationshipfunction`entity_field_offset` should be the offset from the base of this component and point to a field that stores value of type [`Entity`]. This value can be obtained using the [`core::mem::offset_of`] macro.
85bevy_ecs::schedule::executor::SystemSchedulesystems_mutfunction- The only allowed mutations are from calling methods on the [`System`] trait. Replacing systems in the returned [`Vec`] should be considered undefined behavior.
86bevy_ecs::storage::table::Tableget_componentfunction`row.as_usize()` < `self.len()`
87bevy_ecs::storage::table::Tableget_data_slice_forfunction`row.as_usize()` < `self.len()` - `T` must match the `component_id`
88bevy_ecs::storage::table::Tableget_ticks_uncheckedfunction- `row.as_usize()` < `self.len()`
89bevy_ecs::storage::table::column::Columnget_added_tick_uncheckedfunction`row` must be within the range `[0, self.len())`.
90bevy_ecs::storage::table::column::Columnget_added_ticks_slicefunction- `len` must match the actual length of this column (number of elements stored)
91bevy_ecs::storage::table::column::Columnget_changed_by_slicefunction- `len` must match the actual length of this column (number of elements stored)
92bevy_ecs::storage::table::column::Columnget_changed_by_uncheckedfunction`row` must be within the range `[0, self.len())`.
93bevy_ecs::storage::table::column::Columnget_changed_tick_uncheckedfunction`row` must be within the range `[0, self.len())`.
94bevy_ecs::storage::table::column::Columnget_changed_ticks_slicefunction- `len` must match the actual length of this column (number of elements stored)
95bevy_ecs::storage::table::column::Columnget_data_slicefunction- `T` must match the type of data that's stored in this [`Column`] - `len` must match the actual length of this column (number of elements stored)
96bevy_ecs::storage::table::column::Columnget_data_uncheckedfunction- `row` must be within the range `[0, self.len())`. - no other mutable reference to the data of the same row can exist at the same time
97bevy_ecs::storage::table::column::Columnget_ticks_uncheckedfunction`row` must be within the range `[0, self.len())`.
98bevy_ecs::system::builderSystemParamBuildertraitThe implementor must ensure that the state returned from [`SystemParamBuilder::build`] is valid for `P`. Note that the exact safety requirements depend on the implementation of [`SystemParam`], so if `Self` is not a local type then you must call [`SystemParam::init_state`] or another [`SystemParamBuilder::build`].
99bevy_ecs::system::commands::EntityCommandsinsert_by_idfunction- [`ComponentId`] must be from the same world as `self`. - `T` must have the same layout as the one passed during `component_id` creation.
100bevy_ecs::system::commands::EntityCommandstry_insert_by_idfunction- [`ComponentId`] must be from the same world as `self`. - `T` must have the same layout as the one passed during `component_id` creation.
101bevy_ecs::system::commands::entity_commandinsert_by_idfunction- [`ComponentId`] must be from the same world as the target entity. - `T` must have the same layout as the one passed during `component_id` creation.
102bevy_ecs::system::function_system::SystemStateget_uncheckedfunctionThis call might access any of the input parameters in a way that violates Rust's mutability rules. Make sure the data access is safe in the context of global [`World`] access. The passed-in [`World`] _must_ be the [`World`] the [`SystemState`] was created with.
103bevy_ecs::system::function_system::SystemStateparam_state_mutfunctionModifying the system param states may have unintended consequences. The param state is generally considered to be owned by the [`SystemParam`]. Modifications should respect any invariants as required by the [`SystemParam`]. For example, modifying the system state of [`ResMut`](crate::system::ResMut) will obviously create issues.
104bevy_ecs::system::query::Queryget_uncheckedfunctionThis function makes it possible to violate Rust's aliasing guarantees. You must make sure this call does not result in multiple mutable references to the same component.
105bevy_ecs::system::query::Queryiter_combinations_unsafefunctionThis allows aliased mutability. You must make sure this call does not result in multiple mutable references to the same component.
106bevy_ecs::system::query::Queryiter_many_unique_unsafefunctionThis allows aliased mutability. You must make sure this call does not result in multiple mutable references to the same component.
107bevy_ecs::system::query::Queryiter_many_unsafefunctionThis allows aliased mutability and does not check for entity uniqueness. You must make sure this call does not result in multiple mutable references to the same component. Particular care must be taken when collecting the data (rather than iterating over it one item at a time) such as via [`Iterator::collect`].
108bevy_ecs::system::query::Queryiter_unsafefunctionThis function makes it possible to violate Rust's aliasing guarantees. You must make sure this call does not result in multiple mutable references to the same component.
109bevy_ecs::system::query::Queryreborrow_unsafefunctionThis function makes it possible to violate Rust's aliasing guarantees. You must make sure this call does not result in a mutable or shared reference to a component with a mutable reference.
110bevy_ecs::system::systemReadOnlySystemtraitThis must only be implemented for system types which do not mutate the `World` when [`System::run_unsafe`] is called.
111bevy_ecs::system::system_paramReadOnlySystemParamtraitThis must only be implemented for [`SystemParam`] impls that exclusively read the World passed in to [`SystemParam::get_param`]
112bevy_ecs::system::system_paramSystemParamtraitThe implementor must ensure the following is true. - [`SystemParam::init_access`] correctly registers all [`World`] accesses used by [`SystemParam::get_param`] with the provided [`system_meta`](SystemMeta). - None of the world accesses may conflict with any prior accesses registered on `system_meta`.
113bevy_ecs::world::Worldentities_mutfunctionMutable reference must not be used to put the [`Entities`] data in an invalid state for this [`World`]
114bevy_ecs::world::Worldinsert_non_send_by_idfunctionThe value referenced by `value` must be valid for the given [`ComponentId`] of this world.
115bevy_ecs::world::Worldinsert_resource_by_idfunctionThe value referenced by `value` must be valid for the given [`ComponentId`] of this world.
116bevy_ecs::world::deferred_world::DeferredWorldtrigger_rawfunction- Caller must ensure `E` is accessible as the type represented by `event_key`
117bevy_ecs::world::entity_access::component_fetchDynamicComponentFetchtraitImplementor must ensure that: - No aliased mutability is caused by the returned references. - [`DynamicComponentFetch::fetch_ref`] returns only read-only references.
118bevy_ecs::world::entity_access::entity_mut::EntityMutget_components_mut_uncheckedfunctionIt is the caller's responsibility to ensure that the `QueryData` does not provide aliasing mutable references to the same component.
119bevy_ecs::world::entity_access::entity_mut::EntityMutget_mut_assume_mutablefunction- `T` must be a mutable component
120bevy_ecs::world::entity_access::entity_mut::EntityMutget_mut_assume_mutable_by_idfunctionIt is the callers responsibility to ensure that - the provided [`ComponentId`]s must refer to mutable components.
121bevy_ecs::world::entity_access::entity_mut::EntityMutget_mut_assume_mutable_by_id_uncheckedfunctionIt is the callers responsibility to ensure that - the [`UnsafeEntityCell`] has permission to access the component mutably - no other references to the component exist at the same time - the provided [`ComponentId`]s must refer to mutable components.
122bevy_ecs::world::entity_access::entity_mut::EntityMutget_mut_by_id_uncheckedfunctionIt is the callers responsibility to ensure that - the [`UnsafeEntityCell`] has permission to access the component mutably - no other references to the component exist at the same time
123bevy_ecs::world::entity_access::entity_mut::EntityMutinto_components_mut_uncheckedfunctionIt is the caller's responsibility to ensure that the `QueryData` does not provide aliasing mutable references to the same component.
124bevy_ecs::world::entity_access::entity_mut::EntityMutinto_mut_assume_mutablefunction- `T` must be a mutable component
125bevy_ecs::world::entity_access::entity_mut::EntityMutinto_mut_assume_mutable_by_idfunctionIt is the callers responsibility to ensure that - the provided [`ComponentId`]s must refer to mutable components.
126bevy_ecs::world::entity_access::filtered::FilteredEntityMutget_mut_by_id_uncheckedfunctionNo other references to the same component may exist at the same time as the returned reference.
127bevy_ecs::world::entity_access::filtered::FilteredEntityMutget_mut_uncheckedfunctionNo other references to the same component may exist at the same time as the returned reference.
128bevy_ecs::world::entity_access::filtered::FilteredEntityMutinto_mut_assume_mutablefunction- `T` must be a mutable component
129bevy_ecs::world::entity_access::filtered::UnsafeFilteredEntityMutinto_mutfunction- The user must ensure that no aliasing violations occur when using the returned `FilteredEntityMut`.
130bevy_ecs::world::entity_access::world_mut::EntityWorldMutget_components_mut_uncheckedfunctionIt is the caller's responsibility to ensure that the `QueryData` does not provide aliasing mutable references to the same component. /// # See also - [`Self::get_components_mut`] for the safe version that performs aliasing checks
131bevy_ecs::world::entity_access::world_mut::EntityWorldMutget_mut_assume_mutablefunction- `T` must be a mutable component
132bevy_ecs::world::entity_access::world_mut::EntityWorldMutget_mut_assume_mutable_by_idfunctionIt is the callers responsibility to ensure that - the provided [`ComponentId`]s must refer to mutable components.
133bevy_ecs::world::entity_access::world_mut::EntityWorldMutinsert_by_idfunction- [`ComponentId`] must be from the same world as [`EntityWorldMut`] - [`OwningPtr`] must be a valid reference to the type represented by [`ComponentId`]
134bevy_ecs::world::entity_access::world_mut::EntityWorldMutinsert_by_idsfunction- Each [`ComponentId`] must be from the same world as [`EntityWorldMut`] - Each [`OwningPtr`] must be a valid reference to the type represented by [`ComponentId`]
135bevy_ecs::world::entity_access::world_mut::EntityWorldMutinto_components_mut_uncheckedfunctionIt is the caller's responsibility to ensure that the `QueryData` does not provide aliasing mutable references to the same component.
136bevy_ecs::world::entity_access::world_mut::EntityWorldMutinto_mut_assume_mutablefunction- `T` must be a mutable component
137bevy_ecs::world::entity_access::world_mut::EntityWorldMutinto_mut_assume_mutable_by_idfunctionIt is the callers responsibility to ensure that - the provided [`ComponentId`]s must refer to mutable components.
138bevy_ecs::world::entity_access::world_mut::EntityWorldMutworld_mutfunctionCaller must not modify the world in a way that changes the current entity's location If the caller _does_ do something that could change the location, `self.update_location()` must be called before using any other methods on this [`EntityWorldMut`].
139bevy_ecs::world::entity_fetchWorldEntityFetchtraitImplementor must ensure that: - No aliased mutability is caused by the returned references. - [`WorldEntityFetch::fetch_ref`] returns only read-only references. - [`WorldEntityFetch::fetch_deferred_mut`] returns only non-structurally-mutable references. [`World`]: crate::world::World
140bevy_ecs::world::unsafe_world_cell::UnsafeEntityCellgetfunctionIt is the caller's responsibility to ensure that - the [`UnsafeEntityCell`] has permission to access the component - no other mutable references to the component exist at the same time
141bevy_ecs::world::unsafe_world_cell::UnsafeEntityCellget_by_idfunctionIt is the caller's responsibility to ensure that - the [`UnsafeEntityCell`] has permission to access the component - no other mutable references to the component exist at the same time
142bevy_ecs::world::unsafe_world_cell::UnsafeEntityCellget_change_ticksfunctionIt is the caller's responsibility to ensure that - the [`UnsafeEntityCell`] has permission to access the component - no other mutable references to the component exist at the same time
143bevy_ecs::world::unsafe_world_cell::UnsafeEntityCellget_change_ticks_by_idfunctionIt is the caller's responsibility to ensure that - the [`UnsafeEntityCell`] has permission to access the component - no other mutable references to the component exist at the same time
144bevy_ecs::world::unsafe_world_cell::UnsafeEntityCellget_changed_byfunctionIt is the caller's responsibility to ensure that - the [`UnsafeEntityCell`] has permission to access the component - no other mutable references to the component exist at the same time
145bevy_ecs::world::unsafe_world_cell::UnsafeEntityCellget_mutfunctionIt is the caller's responsibility to ensure that - the [`UnsafeEntityCell`] has permission to access the component mutably - no other references to the component exist at the same time
146bevy_ecs::world::unsafe_world_cell::UnsafeEntityCellget_mut_assume_mutablefunctionIt is the caller's responsibility to ensure that - the [`UnsafeEntityCell`] has permission to access the component mutably - no other references to the component exist at the same time - the component `T` is mutable
147bevy_ecs::world::unsafe_world_cell::UnsafeEntityCellget_mut_assume_mutable_by_idfunctionIt is the caller's responsibility to ensure that - the [`UnsafeEntityCell`] has permission to access the component mutably - no other references to the component exist at the same time - the component `T` is mutable
148bevy_ecs::world::unsafe_world_cell::UnsafeEntityCellget_mut_by_idfunctionIt is the caller's responsibility to ensure that - the [`UnsafeEntityCell`] has permission to access the component mutably - no other references to the component exist at the same time
149bevy_ecs::world::unsafe_world_cell::UnsafeEntityCellget_reffunctionIt is the caller's responsibility to ensure that - the [`UnsafeEntityCell`] has permission to access the component - no other mutable references to the component exist at the same time
150bevy_ecs::world::unsafe_world_cell::UnsafeWorldCellfallback_error_handlerfunctionMust have read access to [`FallbackErrorHandler`].
151bevy_ecs::world::unsafe_world_cell::UnsafeWorldCellget_non_sendfunctionIt is the caller's responsibility to ensure that - the [`UnsafeWorldCell`] has permission to access the data - no mutable reference to the data exists at the same time
152bevy_ecs::world::unsafe_world_cell::UnsafeWorldCellget_non_send_by_idfunctionIt is the caller's responsibility to ensure that - the [`UnsafeWorldCell`] has permission to access the data - no mutable reference to the data exists at the same time
153bevy_ecs::world::unsafe_world_cell::UnsafeWorldCellget_non_send_mutfunctionIt is the caller's responsibility to ensure that - the [`UnsafeWorldCell`] has permission to access the data mutably - no other references to the data exist at the same time
154bevy_ecs::world::unsafe_world_cell::UnsafeWorldCellget_non_send_mut_by_idfunctionIt is the caller's responsibility to ensure that - the [`UnsafeWorldCell`] has permission to access the data mutably - no other references to the data exist at the same time
155bevy_ecs::world::unsafe_world_cell::UnsafeWorldCellget_non_send_resourcefunctionIt is the caller's responsibility to ensure that - the [`UnsafeWorldCell`] has permission to access the data - no mutable reference to the data exists at the same time
156bevy_ecs::world::unsafe_world_cell::UnsafeWorldCellget_non_send_resource_by_idfunctionIt is the caller's responsibility to ensure that - the [`UnsafeWorldCell`] has permission to access the data - no mutable reference to the data exists at the same time
157bevy_ecs::world::unsafe_world_cell::UnsafeWorldCellget_non_send_resource_mutfunctionIt is the caller's responsibility to ensure that - the [`UnsafeWorldCell`] has permission to access the data mutably - no other references to the data exist at the same time
158bevy_ecs::world::unsafe_world_cell::UnsafeWorldCellget_non_send_resource_mut_by_idfunctionIt is the caller's responsibility to ensure that - the [`UnsafeWorldCell`] has permission to access the data mutably - no other references to the data exist at the same time
159bevy_ecs::world::unsafe_world_cell::UnsafeWorldCellget_resourcefunctionIt is the caller's responsibility to ensure that - the [`UnsafeWorldCell`] has permission to access the resource - no mutable reference to the resource exists at the same time
160bevy_ecs::world::unsafe_world_cell::UnsafeWorldCellget_resource_by_idfunctionIt is the caller's responsibility to ensure that - the [`UnsafeWorldCell`] has permission to access the resource - no mutable reference to the resource exists at the same time
161bevy_ecs::world::unsafe_world_cell::UnsafeWorldCellget_resource_mutfunctionIt is the caller's responsibility to ensure that - the [`UnsafeWorldCell`] has permission to access the resource mutably - no other references to the resource exist at the same time
162bevy_ecs::world::unsafe_world_cell::UnsafeWorldCellget_resource_mut_by_idfunctionIt is the caller's responsibility to ensure that - the [`UnsafeWorldCell`] has permission to access the resource mutably - no other references to the resource exist at the same time
163bevy_ecs::world::unsafe_world_cell::UnsafeWorldCellget_resource_reffunctionIt is the caller's responsibility to ensure that - the [`UnsafeWorldCell`] has permission to access the resource - no mutable reference to the resource exists at the same time
164bevy_ecs::world::unsafe_world_cell::UnsafeWorldCellinto_deferredfunctionCaller must ensure there are no outstanding mutable references to world and no outstanding references to the world's command queue, resource or component data
165bevy_ecs::world::unsafe_world_cell::UnsafeWorldCellresource_entitiesfunctionThe caller must have exclusive read or write access to the resources that are updated in the cache.
166bevy_ecs::world::unsafe_world_cell::UnsafeWorldCellstoragesfunctionThe caller must ensure that this is only used to access world data that this [`UnsafeWorldCell`] is allowed to. As always, any mutable access to a component must not exist at the same time as any other accesses to that same component.
167bevy_ecs::world::unsafe_world_cell::UnsafeWorldCellworldfunction- must have permission to access the whole world immutably - there must be no live exclusive borrows of world data - there must be no live exclusive borrow of world
168bevy_ecs::world::unsafe_world_cell::UnsafeWorldCellworld_metadatafunction- must only be used to access world metadata
169bevy_ecs::world::unsafe_world_cell::UnsafeWorldCellworld_mutfunction- `self` must have been obtained from a call to [`World::as_unsafe_world_cell`] (*not* `as_unsafe_world_cell_readonly` or any other method of construction that does not provide mutable access to the entire world). - This means that if you have an `UnsafeWorldCell` that you didn't create yourself, it is likely *unsound* to call this method. - The returned `&mut World` *must* be unique: it must never be allowed to exist at the same time as any other borrows of the world or any accesses to its data. This includes safe ways of accessing world data, such as [`UnsafeWorldCell::archetypes`]. - Note that the `&mut World` *may* exist at the same time as instances of `UnsafeWorldCell`, so long as none of those instances are used to access world data in any way while the mutable borrow is active. [//]: # (This test fails miri.) ```no_run
170bevy_platform::collections::hash_map::HashMapget_disjoint_key_value_unchecked_mutfunctionCalling this method with overlapping keys is *[undefined behavior]* even if the resulting references are not used. [undefined behavior]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html
171bevy_platform::collections::hash_map::HashMapget_disjoint_unchecked_mutfunctionCalling this method with overlapping keys is *[undefined behavior]* even if the resulting references are not used. [undefined behavior]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html
172bevy_platform::collections::hash_map::HashMapinsert_unique_uncheckedfunctionThis operation is safe if a key does not exist in the map. However, if a key exists in the map already, the behavior is unspecified: this operation may panic, loop forever, or any following operation with the map may panic, loop forever or return arbitrary result. That said, this operation (and following operations) are guaranteed to not violate memory safety. However this operation is still unsafe because the resulting `HashMap` may be passed to unsafe code which does expect the map to behave correctly, and would cause unsoundness as a result.
173bevy_platform::collections::hash_set::HashSetinsert_unique_uncheckedfunctionThis operation is safe if a value does not exist in the set. However, if a value exists in the set already, the behavior is unspecified: this operation may panic, loop forever, or any following operation with the set may panic, loop forever or return arbitrary result. That said, this operation (and following operations) are guaranteed to not violate memory safety. However this operation is still unsafe because the resulting `HashSet` may be passed to unsafe code which does expect the set to behave correctly, and would cause unsoundness as a result.
174bevy_ptr::ConstNonNullas_reffunctionWhen calling this method, you have to ensure that all of the following is true: * The pointer must be [properly aligned]. * It must be "dereferenceable" in the sense defined in [the module documentation]. * The pointer must point to an initialized instance of `T`. * You must enforce Rust's aliasing rules, since the returned lifetime `'a` is arbitrarily chosen and does not necessarily reflect the actual lifetime of the data. In particular, while this reference exists, the memory the pointer points to must not get mutated (except inside `UnsafeCell`). This applies even if the result of this method is unused! (The part about being initialized is not yet fully decided, but until it is, the only safe approach is to ensure that they are indeed initialized.)
175bevy_ptr::ConstNonNullnew_uncheckedfunction`ptr` must be non-null.
176bevy_ptr::MovingPtrassume_initfunctionIt's up to the caller to ensure that the value pointed to by `self` is really in an initialized state. Calling this when the content is not yet fully initialized causes immediate undefined behavior.
177bevy_ptr::MovingPtrfrom_valuefunction- `value` must store a properly initialized value of type `T`. - Once the returned [`MovingPtr`] has been used, `value` must be treated as it were uninitialized unless it was explicitly leaked via [`core::mem::forget`].
178bevy_ptr::MovingPtrmove_fieldfunction- `f` must return a non-null pointer to a valid field inside `T` - If `A` is [`Aligned`], then `T` must not be `repr(packed)` - `self` should not be accessed or dropped as if it were a complete value after this function returns. Other fields that have not been moved out of may still be accessed or dropped separately. - This function cannot alias the field with any other access, including other calls to [`move_field`] for the same field, without first calling [`forget`] on it first. A result of the above invariants means that any operation that could cause `self` to be dropped while the pointers to the fields are held will result in undefined behavior. This requires extra caution around code that may panic. See the example below for an example of how to safely use this function.
179bevy_ptr::MovingPtrmove_maybe_uninit_fieldfunction- `f` must return a non-null pointer to a valid field inside `T` - If `A` is [`Aligned`], then `T` must not be `repr(packed)` - `self` should not be accessed or dropped as if it were a complete value after this function returns. Other fields that have not been moved out of may still be accessed or dropped separately. - This function cannot alias the field with any other access, including other calls to [`move_field`] for the same field, without first calling [`forget`] on it first. [`forget`]: core::mem::forget [`move_field`]: Self::move_field
180bevy_ptr::MovingPtrnewfunction- `inner` must point to valid value of `T`. - If the `A` type parameter is [`Aligned`] then `inner` must be [properly aligned] for `T`. - `inner` must have correct provenance to allow read and writes of the pointee type. - The lifetime `'a` must be constrained such that this [`MovingPtr`] will stay valid and nothing else can read or mutate the pointee while this [`MovingPtr`] is live. [properly aligned]: https://doc.rust-lang.org/std/ptr/index.html#alignment
181bevy_ptr::MovingPtrwrite_tofunction- `dst` must be valid for writes. - If the `A` type parameter is [`Aligned`] then `dst` must be [properly aligned] for `T`. [properly aligned]: https://doc.rust-lang.org/std/ptr/index.html#alignment
182bevy_ptr::OwningPtrbyte_addfunction- The offset cannot make the existing ptr null, or take it out of bounds for its allocation. - If the `A` type parameter is [`Aligned`] then the offset must not make the resulting pointer be unaligned for the pointee type. - The value pointed by the resulting pointer must outlive the lifetime of this pointer. [ptr_add]: https://doc.rust-lang.org/std/primitive.pointer.html#method.add
183bevy_ptr::OwningPtrbyte_offsetfunction- The offset cannot make the existing ptr null, or take it out of bounds for its allocation. - If the `A` type parameter is [`Aligned`] then the offset must not make the resulting pointer be unaligned for the pointee type. - The value pointed by the resulting pointer must outlive the lifetime of this pointer. [ptr_offset]: https://doc.rust-lang.org/std/primitive.pointer.html#method.offset
184bevy_ptr::OwningPtrcastfunction- `T` must be the erased pointee type for this [`OwningPtr`].
185bevy_ptr::OwningPtrdrop_asfunction- `T` must be the erased pointee type for this [`OwningPtr`]. - If the type parameter `A` is [`Unaligned`] then this pointer must be [properly aligned] for the pointee type `T`. [properly aligned]: https://doc.rust-lang.org/std/ptr/index.html#alignment
186bevy_ptr::OwningPtrnewfunction- `inner` must point to valid value of whatever the pointee type is. - If the `A` type parameter is [`Aligned`] then `inner` must be [properly aligned] for the pointee type. - `inner` must have correct provenance to allow read and writes of the pointee type. - The lifetime `'a` must be constrained such that this [`OwningPtr`] will stay valid and nothing else can read or mutate the pointee while this [`OwningPtr`] is live. [properly aligned]: https://doc.rust-lang.org/std/ptr/index.html#alignment
187bevy_ptr::OwningPtrreadfunction- `T` must be the erased pointee type for this [`OwningPtr`]. - If the type parameter `A` is [`Unaligned`] then this pointer must be [properly aligned] for the pointee type `T`. [properly aligned]: https://doc.rust-lang.org/std/ptr/index.html#alignment
188bevy_ptr::OwningPtrread_unalignedfunction- `T` must be the erased pointee type for this [`OwningPtr`].
189bevy_ptr::Ptrassert_uniquefunction* The data pointed to by this `Ptr` must be valid for writes. * There must be no active references (mutable or otherwise) to the data underlying this `Ptr`. * Another [`PtrMut`] for the same [`Ptr`] must not be created until the first is dropped.
190bevy_ptr::Ptrbyte_addfunction- The offset cannot make the existing ptr null, or take it out of bounds for its allocation. - If the `A` type parameter is [`Aligned`] then the offset must not make the resulting pointer be unaligned for the pointee type. - The value pointed by the resulting pointer must outlive the lifetime of this pointer. [ptr_add]: https://doc.rust-lang.org/std/primitive.pointer.html#method.add
191bevy_ptr::Ptrbyte_offsetfunction- The offset cannot make the existing ptr null, or take it out of bounds for its allocation. - If the `A` type parameter is [`Aligned`] then the offset must not make the resulting pointer be unaligned for the pointee type. - The value pointed by the resulting pointer must outlive the lifetime of this pointer. [ptr_offset]: https://doc.rust-lang.org/std/primitive.pointer.html#method.offset
192bevy_ptr::Ptrdereffunction- `T` must be the erased pointee type for this [`Ptr`]. - If the type parameter `A` is [`Unaligned`] then this pointer must be [properly aligned] for the pointee type `T`. [properly aligned]: https://doc.rust-lang.org/std/ptr/index.html#alignment
193bevy_ptr::Ptrnewfunction- `inner` must point to valid value of whatever the pointee type is. - If the `A` type parameter is [`Aligned`] then `inner` must be [properly aligned] for the pointee type. - `inner` must have correct provenance to allow reads of the pointee type. - The lifetime `'a` must be constrained such that this [`Ptr`] will stay valid and nothing can mutate the pointee while this [`Ptr`] is live except through an [`UnsafeCell`]. [properly aligned]: https://doc.rust-lang.org/std/ptr/index.html#alignment
194bevy_ptr::PtrMutbyte_addfunction- The offset cannot make the existing ptr null, or take it out of bounds for its allocation. - If the `A` type parameter is [`Aligned`] then the offset must not make the resulting pointer be unaligned for the pointee type. - The value pointed by the resulting pointer must outlive the lifetime of this pointer. [ptr_add]: https://doc.rust-lang.org/std/primitive.pointer.html#method.add
195bevy_ptr::PtrMutbyte_offsetfunction- The offset cannot make the existing ptr null, or take it out of bounds for its allocation. - If the `A` type parameter is [`Aligned`] then the offset must not make the resulting pointer be unaligned for the pointee type. - The value pointed by the resulting pointer must outlive the lifetime of this pointer. [ptr_offset]: https://doc.rust-lang.org/std/primitive.pointer.html#method.offset
196bevy_ptr::PtrMutderef_mutfunction- `T` must be the erased pointee type for this [`PtrMut`]. - If the type parameter `A` is [`Unaligned`] then this pointer must be [properly aligned] for the pointee type `T`. [properly aligned]: https://doc.rust-lang.org/std/ptr/index.html#alignment
197bevy_ptr::PtrMutnewfunction- `inner` must point to valid value of whatever the pointee type is. - If the `A` type parameter is [`Aligned`] then `inner` must be [properly aligned] for the pointee type. - `inner` must have correct provenance to allow read and writes of the pointee type. - The lifetime `'a` must be constrained such that this [`PtrMut`] will stay valid and nothing else can read or mutate the pointee while this [`PtrMut`] is live. [properly aligned]: https://doc.rust-lang.org/std/ptr/index.html#alignment
198bevy_ptr::PtrMutpromotefunctionMust have right to drop or move out of [`PtrMut`].
199bevy_ptr::ThinSlicePtras_mut_slice_uncheckedfunction- There must not be any aliases for the lifetime `'a` to the slice. - `len` must be less than or equal to the length of the slice.
200bevy_ptr::ThinSlicePtras_slice_uncheckedfunction- There must be no mutable aliases for the lifetime `'a` to the slice. to the slice. - `len` must be less than or equal to the length of the slice.
201bevy_ptr::ThinSlicePtrgetfunction`index` must be in-bounds.
202bevy_ptr::ThinSlicePtrget_uncheckedfunction`index` must be in-bounds.
203bevy_reflect::type_registry::ReflectFromPtras_reflectfunction`val` must be a pointer to value of the type that the [`ReflectFromPtr`] was constructed for. This can be verified by checking that the type id returned by [`ReflectFromPtr::type_id`] is the expected one.
204bevy_reflect::type_registry::ReflectFromPtras_reflect_mutfunction`val` must be a pointer to a value of the type that the [`ReflectFromPtr`] was constructed for This can be verified by checking that the type id returned by [`ReflectFromPtr::type_id`] is the expected one.
205bevy_render::render_resource::atomic_podAtomicPodBlobtraitThis trait must only be implemented by types that are `#[repr(transparent)]` wrappers around `[AtomicU32; N]` for some N (where N may legally be 0). That's because values implementing this trait are read as a `&[u8]` when uploading to the GPU.
206bevy_render::renderer::render_device::RenderDevicecreate_shader_modulefunctionCreates a shader module with user-customizable runtime checks which allows shaders to perform operations which can lead to undefined behavior like indexing out of bounds, To avoid UB, ensure any unchecked shaders are sound! This method should never be called for user-supplied shaders.
207bevy_window::raw_handle::RawHandleWrapperget_handlefunctionSome platforms have constraints on where/how this handle can be used. For example, some platforms don't support doing window operations off of the main thread. The caller must ensure the [`RawHandleWrapper`] is only used in valid contexts.
208bevy_window::raw_handle::RawHandleWrapperset_window_handlefunctionThe passed in [`RawWindowHandle`] must be a valid window handle.