Generated from workspace: bevy.
| Index | Module Path | API Name | Kind | Safety Doc | Mark |
|---|---|---|---|---|---|
| 1 | bevy_asset::reflect::ReflectAsset | get_unchecked_mut | function | This 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. | |
| 2 | bevy_ecs::bundle | Bundle | trait | Manual 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 | |
| 3 | bevy_ecs::bundle | BundleFromComponents | trait | Manual 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 | |
| 4 | bevy_ecs::bundle::writer::BundleScratch | manual_drop | function | `components` must be from the same world as the components that were pushed to this writer. | |
| 5 | bevy_ecs::bundle::writer::BundleWriter | push_component | function | `components` must be from the same world that all previous [`Self::push_component`] calls were called with, and the _next_ [`Self::write`] call. | |
| 6 | bevy_ecs::bundle::writer::BundleWriter | push_component_by_id | function | `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. | |
| 7 | bevy_ecs::bundle::writer::BundleWriter | write | function | `entity` must be from the same world that all [`Self::push_component`] calls since the last [`Self::write`] were called with. | |
| 8 | bevy_ecs::change_detection::params::MutUntyped | with_type | function | - `T` must be the erased pointee type for this [`MutUntyped`]. | |
| 9 | bevy_ecs::component::info::ComponentDescriptor | new_with_layout | function | - 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` | |
| 10 | bevy_ecs::component::info::Components | get_info_unchecked | function | `id` must be a valid and fully registered [`ComponentId`]. | |
| 11 | bevy_ecs::component::register::ComponentsQueuedRegistrator | new | function | The [`Components`] and [`ComponentIds`] must match. For example, they must be from the same world. | |
| 12 | bevy_ecs::component::register::ComponentsRegistrator | new | function | The [`Components`] and [`ComponentIds`] must match. For example, they must be from the same world. | |
| 13 | bevy_ecs::component::required::RequiredComponentConstructor | new | function | - `component_id` must be a valid component for type `C`. | |
| 14 | bevy_ecs::component::required::RequiredComponentsRegistrator | register_required_by_id | function | `component_id` must be a valid [`ComponentId`] for `C` in the [`Components`] instance of `self`. | |
| 15 | bevy_ecs::component::required::RequiredComponentsRegistrator | register_required_dynamic_with | function | - `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`. | |
| 16 | bevy_ecs::entity::clone_entities::ComponentCloneCtx | write_target_component_ptr | function | Caller 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). | |
| 17 | bevy_ecs::entity::entity_set | EntityEquivalent | trait | Any [`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 | |
| 18 | bevy_ecs::entity::entity_set | EntitySetIterator | trait | `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. | |
| 19 | bevy_ecs::entity::entity_set::UniqueEntityIter | as_mut_inner | function | `self` must always contain an iterator that yields unique elements, even while this reference is live. | |
| 20 | bevy_ecs::entity::entity_set::UniqueEntityIter | from_iterator_unchecked | function | `iter` must only yield unique elements. As in, the resulting iterator must adhere to the safety contract of [`EntitySetIterator`]. | |
| 21 | bevy_ecs::entity::index_map::Slice | from_boxed_slice_unchecked | function | `slice` must stem from an [`IndexMap`] using [`EntityHash`]. [`entity::index_map::Slice`]: `crate::entity::index_map::Slice` | |
| 22 | bevy_ecs::entity::index_map::Slice | from_slice_unchecked | function | `slice` must stem from an [`IndexMap`] using [`EntityHash`]. [`entity::index_map::Slice`]: `crate::entity::index_map::Slice` | |
| 23 | bevy_ecs::entity::index_map::Slice | from_slice_unchecked_mut | function | `slice` must stem from an [`IndexMap`] using [`EntityHash`]. [`entity::index_map::Slice`]: `crate::entity::index_map::Slice` | |
| 24 | bevy_ecs::entity::index_set::Slice | from_boxed_slice_unchecked | function | `slice` must stem from an [`IndexSet`] using [`EntityHash`]. [`entity::index_set::Slice`]: `crate::entity::index_set::Slice` | |
| 25 | bevy_ecs::entity::index_set::Slice | from_slice_unchecked | function | `slice` must stem from an [`IndexSet`] using [`EntityHash`]. [`entity::index_set::Slice`]: `crate::entity::index_set::Slice` | |
| 26 | bevy_ecs::entity::index_set::Slice | from_slice_unchecked_mut | function | `slice` must stem from an [`IndexSet`] using [`EntityHash`]. [`entity::index_set::Slice`]: `crate::entity::index_set::Slice` | |
| 27 | bevy_ecs::entity::unique_array::UniqueEntityEquivalentArray | from_arc_array_unchecked | function | `slice` must contain only unique elements. | |
| 28 | bevy_ecs::entity::unique_array::UniqueEntityEquivalentArray | from_array_ref_unchecked | function | `array` must contain only unique elements. | |
| 29 | bevy_ecs::entity::unique_array::UniqueEntityEquivalentArray | from_array_unchecked | function | `array` must contain only unique elements. | |
| 30 | bevy_ecs::entity::unique_array::UniqueEntityEquivalentArray | from_boxed_array_unchecked | function | `array` must contain only unique elements. | |
| 31 | bevy_ecs::entity::unique_array::UniqueEntityEquivalentArray | from_rc_array_unchecked | function | `slice` must contain only unique elements. | |
| 32 | bevy_ecs::entity::unique_slice | cast_slice_of_mut_unique_entity_slice_mut | function | All elements in each of the cast slices must be unique. | |
| 33 | bevy_ecs::entity::unique_slice | cast_slice_of_unique_entity_slice | function | All elements in each of the cast slices must be unique. | |
| 34 | bevy_ecs::entity::unique_slice | cast_slice_of_unique_entity_slice_mut | function | All elements in each of the cast slices must be unique. | |
| 35 | bevy_ecs::entity::unique_slice | from_raw_parts | function | [`slice::from_raw_parts`] must be safe to call with `data` and `len`. Additionally, all elements in the resulting slice must be unique. | |
| 36 | bevy_ecs::entity::unique_slice | from_raw_parts_mut | function | [`slice::from_raw_parts_mut`] must be safe to call with `data` and `len`. Additionally, all elements in the resulting slice must be unique. | |
| 37 | bevy_ecs::entity::unique_slice::UniqueEntityEquivalentSlice | from_arc_slice_unchecked | function | `slice` must contain only unique elements. | |
| 38 | bevy_ecs::entity::unique_slice::UniqueEntityEquivalentSlice | from_boxed_slice_unchecked | function | `slice` must contain only unique elements. | |
| 39 | bevy_ecs::entity::unique_slice::UniqueEntityEquivalentSlice | from_rc_slice_unchecked | function | `slice` must contain only unique elements. | |
| 40 | bevy_ecs::entity::unique_slice::UniqueEntityEquivalentSlice | from_slice_unchecked | function | `slice` must contain only unique elements. | |
| 41 | bevy_ecs::entity::unique_slice::UniqueEntityEquivalentSlice | from_slice_unchecked_mut | function | `slice` must contain only unique elements. | |
| 42 | bevy_ecs::entity::unique_slice::UniqueEntityEquivalentSlice | get_unchecked | function | `index` must be safe to use with [`[T]::get_unchecked`] [`[T]::get_unchecked`]: `slice::get_unchecked` | |
| 43 | bevy_ecs::entity::unique_slice::UniqueEntityEquivalentSlice | get_unchecked_mut | function | `index` must be safe to use with [`[T]::get_unchecked_mut`] [`[T]::get_unchecked_mut`]: `slice::get_unchecked_mut` | |
| 44 | bevy_ecs::entity::unique_slice::UniqueEntityEquivalentSlice | split_at_mut_unchecked | function | `mid` must be safe to use in [`[T]::split_at_mut_unchecked`]. [`[T]::split_at_mut_unchecked`]: `slice::split_at_mut_unchecked` | |
| 45 | bevy_ecs::entity::unique_slice::UniqueEntityEquivalentSlice | split_at_unchecked | function | `mid` must be safe to use in [`[T]::split_at_unchecked`]. [`[T]::split_at_unchecked`]: `slice::split_at_unchecked` | |
| 46 | bevy_ecs::entity::unique_slice::UniqueEntityEquivalentSliceIter | as_mut_inner | function | `self` must always contain an iterator that yields unique elements, even while this reference is live. | |
| 47 | bevy_ecs::entity::unique_slice::UniqueEntityEquivalentSliceIter | from_slice_iterator_unchecked | function | All elements in each of the slices must be unique. | |
| 48 | bevy_ecs::entity::unique_slice::UniqueEntityEquivalentSliceIterMut | as_mut_inner | function | `self` must always contain an iterator that yields unique elements, even while this reference is live. | |
| 49 | bevy_ecs::entity::unique_slice::UniqueEntityEquivalentSliceIterMut | from_mut_slice_iterator_unchecked | function | All elements in each of the slices must be unique. | |
| 50 | bevy_ecs::entity::unique_vec::UniqueEntityEquivalentVec | append | function | `other` must contain no elements that equal any element in `self`. | |
| 51 | bevy_ecs::entity::unique_vec::UniqueEntityEquivalentVec | as_mut_vec | function | The elements of this `Vec` must always remain unique, even while this mutable reference is live. | |
| 52 | bevy_ecs::entity::unique_vec::UniqueEntityEquivalentVec | dedup_by | function | `self` must only contain unique elements after each individual execution of `same_bucket`. | |
| 53 | bevy_ecs::entity::unique_vec::UniqueEntityEquivalentVec | dedup_by_key | function | `self` must only contain unique elements after each individual execution of `key`. | |
| 54 | bevy_ecs::entity::unique_vec::UniqueEntityEquivalentVec | from_raw_parts | function | It must be safe to call [`Vec::from_raw_parts`] with these inputs, and the resulting [`Vec`] must only contain unique elements. | |
| 55 | bevy_ecs::entity::unique_vec::UniqueEntityEquivalentVec | from_vec_unchecked | function | `vec` must contain only unique elements. | |
| 56 | bevy_ecs::entity::unique_vec::UniqueEntityEquivalentVec | insert | function | No `T` contained by `self` may equal `element`. | |
| 57 | bevy_ecs::entity::unique_vec::UniqueEntityEquivalentVec | push | function | No `T` contained by `self` may equal `element`. | |
| 58 | bevy_ecs::entity::unique_vec::UniqueEntityEquivalentVec | resize_with | function | `f` must only produce unique `T`, and none of these may equal any `T` in `self`. | |
| 59 | bevy_ecs::entity::unique_vec::UniqueEntityEquivalentVec | retain_mut | function | `self` must only contain unique elements after each individual execution of `f`. | |
| 60 | bevy_ecs::entity::unique_vec::UniqueEntityEquivalentVec | set_len | function | It must be safe to call [`Vec::set_len`] with these inputs, and the resulting [`Vec`] must only contain unique elements. | |
| 61 | bevy_ecs::entity::unique_vec::UniqueEntityEquivalentVec | splice | function | `replace_with` must not yield any elements that equal any elements in `self`, except for those in `range`. | |
| 62 | bevy_ecs::event::trigger | Trigger | trait | Implementing 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. | |
| 63 | bevy_ecs::event::trigger | trigger_entity_internal | function | - `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 | |
| 64 | bevy_ecs::observer::distributed_storage::Observer | with_event_key | function | The type of the `event_key` [`EventKey`] _must_ match the actual value of the event passed into the observer system. | |
| 65 | bevy_ecs::observer::distributed_storage::ObserverDescriptor | with_event_keys | function | The type of each [`EventKey`] in `event_keys` _must_ match the actual value of the event passed into the observer. | |
| 66 | bevy_ecs::query::fetch | IterQueryData | trait | This [`QueryData`] must not perform conflicting access when fetched for different entities. | |
| 67 | bevy_ecs::query::fetch | QueryData | trait | - 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 | |
| 68 | bevy_ecs::query::fetch | ReadOnlyQueryData | trait | This must only be implemented for read-only [`QueryData`]'s. | |
| 69 | bevy_ecs::query::fetch | SingleEntityQueryData | trait | This [`QueryData`] must only access data from the current entity, and not any other entities. | |
| 70 | bevy_ecs::query::filter | QueryFilter | trait | The [`WorldQuery`] implementation must not take any mutable access. This is the same safety requirement as [`ReadOnlyQueryData`](crate::query::ReadOnlyQueryData). | |
| 71 | bevy_ecs::query::state::QueryState | get_unchecked | function | This does not check for mutable query correctness. To be safe, make sure mutable queries have unique access to the components they query. | |
| 72 | bevy_ecs::query::state::QueryState | iter_combinations_unchecked | function | This does not check for mutable query correctness. To be safe, make sure mutable queries have unique access to the components they query. | |
| 73 | bevy_ecs::query::state::QueryState | iter_unchecked | function | This does not check for mutable query correctness. To be safe, make sure mutable queries have unique access to the components they query. | |
| 74 | bevy_ecs::query::state::QueryState | new_archetype | function | `archetype` must be from the `World` this state was initialized from. | |
| 75 | bevy_ecs::query::state::QueryState | new_unchecked | function | If 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. | |
| 76 | bevy_ecs::query::state::QueryState | query_unchecked | function | This does not check for mutable query correctness. To be safe, make sure mutable queries have unique access to the components they query. | |
| 77 | bevy_ecs::query::state::QueryState | query_unchecked_manual | function | This 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. | |
| 78 | bevy_ecs::query::state::QueryState | query_unchecked_manual_with_ticks | function | This 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. | |
| 79 | bevy_ecs::query::state::QueryState | query_unchecked_with_ticks | function | This does not check for mutable query correctness. To be safe, make sure mutable queries have unique access to the components they query. | |
| 80 | bevy_ecs::query::state::QueryState | single_unchecked | function | This does not check for mutable query correctness. To be safe, make sure mutable queries have unique access to the components they query. | |
| 81 | bevy_ecs::query::state::QueryState | single_unchecked_manual | function | This 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. | |
| 82 | bevy_ecs::query::world_query | WorldQuery | trait | Implementor 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 | |
| 83 | bevy_ecs::reflect::component::ReflectComponent | reflect_unchecked_mut | function | This 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`]. | |
| 84 | bevy_ecs::relationship::ComponentRelationshipAccessor | relationship | function | `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. | |
| 85 | bevy_ecs::schedule::executor::SystemSchedule | systems_mut | function | - The only allowed mutations are from calling methods on the [`System`] trait. Replacing systems in the returned [`Vec`] should be considered undefined behavior. | |
| 86 | bevy_ecs::storage::table::Table | get_component | function | `row.as_usize()` < `self.len()` | |
| 87 | bevy_ecs::storage::table::Table | get_data_slice_for | function | `row.as_usize()` < `self.len()` - `T` must match the `component_id` | |
| 88 | bevy_ecs::storage::table::Table | get_ticks_unchecked | function | - `row.as_usize()` < `self.len()` | |
| 89 | bevy_ecs::storage::table::column::Column | get_added_tick_unchecked | function | `row` must be within the range `[0, self.len())`. | |
| 90 | bevy_ecs::storage::table::column::Column | get_added_ticks_slice | function | - `len` must match the actual length of this column (number of elements stored) | |
| 91 | bevy_ecs::storage::table::column::Column | get_changed_by_slice | function | - `len` must match the actual length of this column (number of elements stored) | |
| 92 | bevy_ecs::storage::table::column::Column | get_changed_by_unchecked | function | `row` must be within the range `[0, self.len())`. | |
| 93 | bevy_ecs::storage::table::column::Column | get_changed_tick_unchecked | function | `row` must be within the range `[0, self.len())`. | |
| 94 | bevy_ecs::storage::table::column::Column | get_changed_ticks_slice | function | - `len` must match the actual length of this column (number of elements stored) | |
| 95 | bevy_ecs::storage::table::column::Column | get_data_slice | function | - `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) | |
| 96 | bevy_ecs::storage::table::column::Column | get_data_unchecked | function | - `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 | |
| 97 | bevy_ecs::storage::table::column::Column | get_ticks_unchecked | function | `row` must be within the range `[0, self.len())`. | |
| 98 | bevy_ecs::system::builder | SystemParamBuilder | trait | The 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`]. | |
| 99 | bevy_ecs::system::commands::EntityCommands | insert_by_id | function | - [`ComponentId`] must be from the same world as `self`. - `T` must have the same layout as the one passed during `component_id` creation. | |
| 100 | bevy_ecs::system::commands::EntityCommands | try_insert_by_id | function | - [`ComponentId`] must be from the same world as `self`. - `T` must have the same layout as the one passed during `component_id` creation. | |
| 101 | bevy_ecs::system::commands::entity_command | insert_by_id | function | - [`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. | |
| 102 | bevy_ecs::system::function_system::SystemState | get_unchecked | function | This 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. | |
| 103 | bevy_ecs::system::function_system::SystemState | param_state_mut | function | Modifying 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. | |
| 104 | bevy_ecs::system::query::Query | get_unchecked | function | This 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. | |
| 105 | bevy_ecs::system::query::Query | iter_combinations_unsafe | function | This allows aliased mutability. You must make sure this call does not result in multiple mutable references to the same component. | |
| 106 | bevy_ecs::system::query::Query | iter_many_unique_unsafe | function | This allows aliased mutability. You must make sure this call does not result in multiple mutable references to the same component. | |
| 107 | bevy_ecs::system::query::Query | iter_many_unsafe | function | This 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`]. | |
| 108 | bevy_ecs::system::query::Query | iter_unsafe | function | This 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. | |
| 109 | bevy_ecs::system::query::Query | reborrow_unsafe | function | This 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. | |
| 110 | bevy_ecs::system::system | ReadOnlySystem | trait | This must only be implemented for system types which do not mutate the `World` when [`System::run_unsafe`] is called. | |
| 111 | bevy_ecs::system::system_param | ReadOnlySystemParam | trait | This must only be implemented for [`SystemParam`] impls that exclusively read the World passed in to [`SystemParam::get_param`] | |
| 112 | bevy_ecs::system::system_param | SystemParam | trait | The 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`. | |
| 113 | bevy_ecs::world::World | entities_mut | function | Mutable reference must not be used to put the [`Entities`] data in an invalid state for this [`World`] | |
| 114 | bevy_ecs::world::World | insert_non_send_by_id | function | The value referenced by `value` must be valid for the given [`ComponentId`] of this world. | |
| 115 | bevy_ecs::world::World | insert_resource_by_id | function | The value referenced by `value` must be valid for the given [`ComponentId`] of this world. | |
| 116 | bevy_ecs::world::deferred_world::DeferredWorld | trigger_raw | function | - Caller must ensure `E` is accessible as the type represented by `event_key` | |
| 117 | bevy_ecs::world::entity_access::component_fetch | DynamicComponentFetch | trait | Implementor must ensure that: - No aliased mutability is caused by the returned references. - [`DynamicComponentFetch::fetch_ref`] returns only read-only references. | |
| 118 | bevy_ecs::world::entity_access::entity_mut::EntityMut | get_components_mut_unchecked | function | It is the caller's responsibility to ensure that the `QueryData` does not provide aliasing mutable references to the same component. | |
| 119 | bevy_ecs::world::entity_access::entity_mut::EntityMut | get_mut_assume_mutable | function | - `T` must be a mutable component | |
| 120 | bevy_ecs::world::entity_access::entity_mut::EntityMut | get_mut_assume_mutable_by_id | function | It is the callers responsibility to ensure that - the provided [`ComponentId`]s must refer to mutable components. | |
| 121 | bevy_ecs::world::entity_access::entity_mut::EntityMut | get_mut_assume_mutable_by_id_unchecked | function | It 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. | |
| 122 | bevy_ecs::world::entity_access::entity_mut::EntityMut | get_mut_by_id_unchecked | function | It 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 | |
| 123 | bevy_ecs::world::entity_access::entity_mut::EntityMut | into_components_mut_unchecked | function | It is the caller's responsibility to ensure that the `QueryData` does not provide aliasing mutable references to the same component. | |
| 124 | bevy_ecs::world::entity_access::entity_mut::EntityMut | into_mut_assume_mutable | function | - `T` must be a mutable component | |
| 125 | bevy_ecs::world::entity_access::entity_mut::EntityMut | into_mut_assume_mutable_by_id | function | It is the callers responsibility to ensure that - the provided [`ComponentId`]s must refer to mutable components. | |
| 126 | bevy_ecs::world::entity_access::filtered::FilteredEntityMut | get_mut_by_id_unchecked | function | No other references to the same component may exist at the same time as the returned reference. | |
| 127 | bevy_ecs::world::entity_access::filtered::FilteredEntityMut | get_mut_unchecked | function | No other references to the same component may exist at the same time as the returned reference. | |
| 128 | bevy_ecs::world::entity_access::filtered::FilteredEntityMut | into_mut_assume_mutable | function | - `T` must be a mutable component | |
| 129 | bevy_ecs::world::entity_access::filtered::UnsafeFilteredEntityMut | into_mut | function | - The user must ensure that no aliasing violations occur when using the returned `FilteredEntityMut`. | |
| 130 | bevy_ecs::world::entity_access::world_mut::EntityWorldMut | get_components_mut_unchecked | function | It 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 | |
| 131 | bevy_ecs::world::entity_access::world_mut::EntityWorldMut | get_mut_assume_mutable | function | - `T` must be a mutable component | |
| 132 | bevy_ecs::world::entity_access::world_mut::EntityWorldMut | get_mut_assume_mutable_by_id | function | It is the callers responsibility to ensure that - the provided [`ComponentId`]s must refer to mutable components. | |
| 133 | bevy_ecs::world::entity_access::world_mut::EntityWorldMut | insert_by_id | function | - [`ComponentId`] must be from the same world as [`EntityWorldMut`] - [`OwningPtr`] must be a valid reference to the type represented by [`ComponentId`] | |
| 134 | bevy_ecs::world::entity_access::world_mut::EntityWorldMut | insert_by_ids | function | - Each [`ComponentId`] must be from the same world as [`EntityWorldMut`] - Each [`OwningPtr`] must be a valid reference to the type represented by [`ComponentId`] | |
| 135 | bevy_ecs::world::entity_access::world_mut::EntityWorldMut | into_components_mut_unchecked | function | It is the caller's responsibility to ensure that the `QueryData` does not provide aliasing mutable references to the same component. | |
| 136 | bevy_ecs::world::entity_access::world_mut::EntityWorldMut | into_mut_assume_mutable | function | - `T` must be a mutable component | |
| 137 | bevy_ecs::world::entity_access::world_mut::EntityWorldMut | into_mut_assume_mutable_by_id | function | It is the callers responsibility to ensure that - the provided [`ComponentId`]s must refer to mutable components. | |
| 138 | bevy_ecs::world::entity_access::world_mut::EntityWorldMut | world_mut | function | Caller 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`]. | |
| 139 | bevy_ecs::world::entity_fetch | WorldEntityFetch | trait | Implementor 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 | |
| 140 | bevy_ecs::world::unsafe_world_cell::UnsafeEntityCell | get | function | It 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 | |
| 141 | bevy_ecs::world::unsafe_world_cell::UnsafeEntityCell | get_by_id | function | It 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 | |
| 142 | bevy_ecs::world::unsafe_world_cell::UnsafeEntityCell | get_change_ticks | function | It 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 | |
| 143 | bevy_ecs::world::unsafe_world_cell::UnsafeEntityCell | get_change_ticks_by_id | function | It 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 | |
| 144 | bevy_ecs::world::unsafe_world_cell::UnsafeEntityCell | get_changed_by | function | It 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 | |
| 145 | bevy_ecs::world::unsafe_world_cell::UnsafeEntityCell | get_mut | function | It 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 | |
| 146 | bevy_ecs::world::unsafe_world_cell::UnsafeEntityCell | get_mut_assume_mutable | function | It 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 | |
| 147 | bevy_ecs::world::unsafe_world_cell::UnsafeEntityCell | get_mut_assume_mutable_by_id | function | It 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 | |
| 148 | bevy_ecs::world::unsafe_world_cell::UnsafeEntityCell | get_mut_by_id | function | It 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 | |
| 149 | bevy_ecs::world::unsafe_world_cell::UnsafeEntityCell | get_ref | function | It 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 | |
| 150 | bevy_ecs::world::unsafe_world_cell::UnsafeWorldCell | fallback_error_handler | function | Must have read access to [`FallbackErrorHandler`]. | |
| 151 | bevy_ecs::world::unsafe_world_cell::UnsafeWorldCell | get_non_send | function | It 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 | |
| 152 | bevy_ecs::world::unsafe_world_cell::UnsafeWorldCell | get_non_send_by_id | function | It 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 | |
| 153 | bevy_ecs::world::unsafe_world_cell::UnsafeWorldCell | get_non_send_mut | function | It 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 | |
| 154 | bevy_ecs::world::unsafe_world_cell::UnsafeWorldCell | get_non_send_mut_by_id | function | It 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 | |
| 155 | bevy_ecs::world::unsafe_world_cell::UnsafeWorldCell | get_non_send_resource | function | It 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 | |
| 156 | bevy_ecs::world::unsafe_world_cell::UnsafeWorldCell | get_non_send_resource_by_id | function | It 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 | |
| 157 | bevy_ecs::world::unsafe_world_cell::UnsafeWorldCell | get_non_send_resource_mut | function | It 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 | |
| 158 | bevy_ecs::world::unsafe_world_cell::UnsafeWorldCell | get_non_send_resource_mut_by_id | function | It 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 | |
| 159 | bevy_ecs::world::unsafe_world_cell::UnsafeWorldCell | get_resource | function | It 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 | |
| 160 | bevy_ecs::world::unsafe_world_cell::UnsafeWorldCell | get_resource_by_id | function | It 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 | |
| 161 | bevy_ecs::world::unsafe_world_cell::UnsafeWorldCell | get_resource_mut | function | It 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 | |
| 162 | bevy_ecs::world::unsafe_world_cell::UnsafeWorldCell | get_resource_mut_by_id | function | It 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 | |
| 163 | bevy_ecs::world::unsafe_world_cell::UnsafeWorldCell | get_resource_ref | function | It 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 | |
| 164 | bevy_ecs::world::unsafe_world_cell::UnsafeWorldCell | into_deferred | function | Caller must ensure there are no outstanding mutable references to world and no outstanding references to the world's command queue, resource or component data | |
| 165 | bevy_ecs::world::unsafe_world_cell::UnsafeWorldCell | resource_entities | function | The caller must have exclusive read or write access to the resources that are updated in the cache. | |
| 166 | bevy_ecs::world::unsafe_world_cell::UnsafeWorldCell | storages | function | The 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. | |
| 167 | bevy_ecs::world::unsafe_world_cell::UnsafeWorldCell | world | function | - 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 | |
| 168 | bevy_ecs::world::unsafe_world_cell::UnsafeWorldCell | world_metadata | function | - must only be used to access world metadata | |
| 169 | bevy_ecs::world::unsafe_world_cell::UnsafeWorldCell | world_mut | function | - `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 | |
| 170 | bevy_platform::collections::hash_map::HashMap | get_disjoint_key_value_unchecked_mut | function | Calling 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 | |
| 171 | bevy_platform::collections::hash_map::HashMap | get_disjoint_unchecked_mut | function | Calling 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 | |
| 172 | bevy_platform::collections::hash_map::HashMap | insert_unique_unchecked | function | This 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. | |
| 173 | bevy_platform::collections::hash_set::HashSet | insert_unique_unchecked | function | This 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. | |
| 174 | bevy_ptr::ConstNonNull | as_ref | function | When 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.) | |
| 175 | bevy_ptr::ConstNonNull | new_unchecked | function | `ptr` must be non-null. | |
| 176 | bevy_ptr::MovingPtr | assume_init | function | It'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. | |
| 177 | bevy_ptr::MovingPtr | from_value | function | - `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`]. | |
| 178 | bevy_ptr::MovingPtr | move_field | function | - `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. | |
| 179 | bevy_ptr::MovingPtr | move_maybe_uninit_field | function | - `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 | |
| 180 | bevy_ptr::MovingPtr | new | function | - `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 | |
| 181 | bevy_ptr::MovingPtr | write_to | function | - `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 | |
| 182 | bevy_ptr::OwningPtr | byte_add | function | - 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 | |
| 183 | bevy_ptr::OwningPtr | byte_offset | function | - 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 | |
| 184 | bevy_ptr::OwningPtr | cast | function | - `T` must be the erased pointee type for this [`OwningPtr`]. | |
| 185 | bevy_ptr::OwningPtr | drop_as | function | - `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 | |
| 186 | bevy_ptr::OwningPtr | new | function | - `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 | |
| 187 | bevy_ptr::OwningPtr | read | function | - `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 | |
| 188 | bevy_ptr::OwningPtr | read_unaligned | function | - `T` must be the erased pointee type for this [`OwningPtr`]. | |
| 189 | bevy_ptr::Ptr | assert_unique | function | * 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. | |
| 190 | bevy_ptr::Ptr | byte_add | function | - 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 | |
| 191 | bevy_ptr::Ptr | byte_offset | function | - 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 | |
| 192 | bevy_ptr::Ptr | deref | function | - `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 | |
| 193 | bevy_ptr::Ptr | new | function | - `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 | |
| 194 | bevy_ptr::PtrMut | byte_add | function | - 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 | |
| 195 | bevy_ptr::PtrMut | byte_offset | function | - 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 | |
| 196 | bevy_ptr::PtrMut | deref_mut | function | - `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 | |
| 197 | bevy_ptr::PtrMut | new | function | - `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 | |
| 198 | bevy_ptr::PtrMut | promote | function | Must have right to drop or move out of [`PtrMut`]. | |
| 199 | bevy_ptr::ThinSlicePtr | as_mut_slice_unchecked | function | - 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. | |
| 200 | bevy_ptr::ThinSlicePtr | as_slice_unchecked | function | - 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. | |
| 201 | bevy_ptr::ThinSlicePtr | get | function | `index` must be in-bounds. | |
| 202 | bevy_ptr::ThinSlicePtr | get_unchecked | function | `index` must be in-bounds. | |
| 203 | bevy_reflect::type_registry::ReflectFromPtr | as_reflect | function | `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. | |
| 204 | bevy_reflect::type_registry::ReflectFromPtr | as_reflect_mut | function | `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. | |
| 205 | bevy_render::render_resource::atomic_pod | AtomicPodBlob | trait | This 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. | |
| 206 | bevy_render::renderer::render_device::RenderDevice | create_shader_module | function | Creates 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. | |
| 207 | bevy_window::raw_handle::RawHandleWrapper | get_handle | function | Some 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. | |
| 208 | bevy_window::raw_handle::RawHandleWrapper | set_window_handle | function | The passed in [`RawWindowHandle`] must be a valid window handle. |