pub struct LocalHandle<T>where
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> LocalHandle<T>where
T: ?Sized,
impl<T> LocalHandle<T>where
T: ?Sized,
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> Clone for LocalHandle<T>where
T: ?Sized,
impl<T> Clone for LocalHandle<T>where
T: ?Sized,
Source§fn clone(&self) -> LocalHandle<T>
fn clone(&self) -> LocalHandle<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<T> Copy for LocalHandle<T>where
T: ?Sized,
Source§impl<T> Debug for LocalHandle<T>where
T: ?Sized,
impl<T> Debug for LocalHandle<T>where
T: ?Sized,
Source§impl<'a, T> DerefPlace for LocalHandle<&'a mut T>where
T: ?Sized,
impl<'a, T> DerefPlace for LocalHandle<&'a mut T>where
T: ?Sized,
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,
) -> <LocalHandle<&'a mut T> as DerefPlace>::PointeeHandle
unsafe fn deref_place( self, ) -> <LocalHandle<&'a mut T> as DerefPlace>::PointeeHandle
🔬This is a nightly-only experimental API. (
field_projections #145383)Source§impl<'a, T> DerefPlace for LocalHandle<&'a T>where
T: ?Sized,
impl<'a, T> DerefPlace for LocalHandle<&'a T>where
T: ?Sized,
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) -> <LocalHandle<&'a T> as DerefPlace>::PointeeHandle
unsafe fn deref_place(self) -> <LocalHandle<&'a T> as DerefPlace>::PointeeHandle
🔬This is a nightly-only experimental API. (
field_projections #145383)Source§impl<T> DerefPlace for LocalHandle<*mut T>where
T: ?Sized,
impl<T> DerefPlace for LocalHandle<*mut T>where
T: ?Sized,
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,
) -> <LocalHandle<*mut T> as DerefPlace>::PointeeHandle
unsafe fn deref_place( self, ) -> <LocalHandle<*mut T> as DerefPlace>::PointeeHandle
🔬This is a nightly-only experimental API. (
field_projections #145383)Source§impl<T> DerefPlace for LocalHandle<*const T>where
T: ?Sized,
impl<T> DerefPlace for LocalHandle<*const T>where
T: ?Sized,
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,
) -> <LocalHandle<*const T> as DerefPlace>::PointeeHandle
unsafe fn deref_place( self, ) -> <LocalHandle<*const T> as DerefPlace>::PointeeHandle
🔬This is a nightly-only experimental API. (
field_projections #145383)Source§impl<T> PlaceHandle for LocalHandle<T>where
T: ?Sized,
impl<T> PlaceHandle for LocalHandle<T>where
T: ?Sized,
Source§impl<S> ProjectPlace<S> for LocalHandle<<S as Subplace>::Source>
impl<S> ProjectPlace<S> for LocalHandle<<S as Subplace>::Source>
Source§type Projected = LocalHandle<<S as Subplace>::Target>
type Projected = LocalHandle<<S as Subplace>::Target>
🔬This is a nightly-only experimental API. (
field_projections #145383)Source§unsafe fn project_place(
self,
subplace: S,
) -> <LocalHandle<<S as Subplace>::Source> as ProjectPlace<S>>::Projected
unsafe fn project_place( self, subplace: S, ) -> <LocalHandle<<S as Subplace>::Source> as ProjectPlace<S>>::Projected
🔬This is a nightly-only experimental API. (
field_projections #145383)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>where
T: ?Sized,
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