mirror of
https://github.com/bevyengine/bevy
synced 2025-01-13 13:49:10 +00:00
f2f8f9097f
# Objective Currently, `Ptr` and `PtrMut` can only be constructed via unsafe code. This means that downgrading a reference to an untyped pointer is very cumbersome, despite being a very simple operation. ## Solution Define conversions for easily and safely constructing untyped pointers. This is the non-owned counterpart to `OwningPtr::make`. Before: ```rust let ptr = unsafe { PtrMut::new(NonNull::from(&mut value).cast()) }; ``` After: ```rust let ptr = PtrMut::from(&mut value); ``` Co-authored-by: Carter Anderson <mcanders1@gmail.com> |
||
---|---|---|
.. | ||
enums | ||
impls | ||
serde | ||
array.rs | ||
fields.rs | ||
lib.rs | ||
list.rs | ||
map.rs | ||
path.rs | ||
reflect.rs | ||
std_traits.rs | ||
struct_trait.rs | ||
tuple.rs | ||
tuple_struct.rs | ||
type_info.rs | ||
type_registry.rs | ||
type_uuid.rs | ||
utility.rs |