pub struct LocalHandle<T: ?Sized> { /* private fields */ }🔬This is a nightly-only experimental API. (
field_projections #145383)Expand description
Primitive handle referring to a local variable or memory location.
§Design Tradeoff & Intermediate Status
LocalHandle is an intermediate concrete handle introduced to enable developing,
testing, and validating place projections (ProjectPlace) and subplaces (Subplace)
prior to full compiler-native place support.
In the full Field Projections design:
- Place capabilities and lifetimes are statically partitioned into dedicated handle
types (e.g.
MutHandle<'a, T>andRefHandle<'a, T>). - Access permissions are checked by the borrow checker through terminal operation
traits (
BorrowPlace,WritePlace,ReadPlace).
In this intermediate milestone:
LocalHandle<T>acts as a unified concrete handle storing a*mut T.- Shared versus exclusive access permissions are not separated into distinct types;
callers must uphold
unsafepreconditions when obtaining or mutating through raw pointers viaas_mut_ptr.
Implementations§
Source§impl<T: ?Sized> LocalHandle<T>
impl<T: ?Sized> LocalHandle<T>
Sourcepub const fn as_ptr(&self) -> *const T
🔬This is a nightly-only experimental API. (field_projections #145383)
pub const fn as_ptr(&self) -> *const T
field_projections #145383)Obtains a const raw pointer to the place.
Sourcepub const fn as_mut_ptr(&self) -> *mut T
🔬This is a nightly-only experimental API. (field_projections #145383)
pub const fn as_mut_ptr(&self) -> *mut T
field_projections #145383)Obtains a mutable raw pointer to the place.
Trait Implementations§
Source§impl<T: ?Sized> Clone for LocalHandle<T>
impl<T: ?Sized> Clone for LocalHandle<T>
impl<T: ?Sized> Copy for LocalHandle<T>
Source§impl<T: ?Sized> Debug for LocalHandle<T>
impl<T: ?Sized> Debug for LocalHandle<T>
Source§impl<'a, T: ?Sized> DerefPlace for LocalHandle<&'a mut T>
impl<'a, T: ?Sized> DerefPlace for LocalHandle<&'a mut T>
Source§type PointeeHandle = MutHandle<'a, T>
type PointeeHandle = MutHandle<'a, T>
🔬This is a nightly-only experimental API. (
field_projections #145383)Source§unsafe fn deref_place(self) -> Self::PointeeHandle
unsafe fn deref_place(self) -> Self::PointeeHandle
🔬This is a nightly-only experimental API. (
field_projections #145383)Source§impl<'a, T: ?Sized> DerefPlace for LocalHandle<&'a T>
impl<'a, T: ?Sized> DerefPlace for LocalHandle<&'a T>
Source§type PointeeHandle = RefHandle<'a, T>
type PointeeHandle = RefHandle<'a, T>
🔬This is a nightly-only experimental API. (
field_projections #145383)Source§unsafe fn deref_place(self) -> Self::PointeeHandle
unsafe fn deref_place(self) -> Self::PointeeHandle
🔬This is a nightly-only experimental API. (
field_projections #145383)Source§impl<T: ?Sized> DerefPlace for LocalHandle<*mut T>
impl<T: ?Sized> DerefPlace for LocalHandle<*mut T>
Source§type PointeeHandle = LocalHandle<T>
type PointeeHandle = LocalHandle<T>
🔬This is a nightly-only experimental API. (
field_projections #145383)Source§unsafe fn deref_place(self) -> Self::PointeeHandle
unsafe fn deref_place(self) -> Self::PointeeHandle
🔬This is a nightly-only experimental API. (
field_projections #145383)Source§impl<T: ?Sized> DerefPlace for LocalHandle<*const T>
impl<T: ?Sized> DerefPlace for LocalHandle<*const T>
Source§type PointeeHandle = LocalHandle<T>
type PointeeHandle = LocalHandle<T>
🔬This is a nightly-only experimental API. (
field_projections #145383)Source§unsafe fn deref_place(self) -> Self::PointeeHandle
unsafe fn deref_place(self) -> Self::PointeeHandle
🔬This is a nightly-only experimental API. (
field_projections #145383)Source§impl<T: ?Sized> PlaceHandle for LocalHandle<T>
impl<T: ?Sized> PlaceHandle for LocalHandle<T>
Source§impl<S> ProjectPlace<S> for LocalHandle<S::Source>
impl<S> ProjectPlace<S> for LocalHandle<S::Source>
Auto Trait Implementations§
impl<T> !Send for LocalHandle<T>
impl<T> !Sync for LocalHandle<T>
impl<T> Forget for LocalHandle<T>where
T: ?Sized,
impl<T> Freeze for LocalHandle<T>
impl<T> Move for LocalHandle<T>
impl<T> RefUnwindSafe for LocalHandle<T>where
T: RefUnwindSafe + ?Sized,
impl<T> Unpin for LocalHandle<T>
impl<T> UnsafeUnpin for LocalHandle<T>
impl<T> UnwindSafe for LocalHandle<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more