Skip to main content

MutHandle

Struct MutHandle 

Source
pub struct MutHandle<'a, T: ?Sized> { /* private fields */ }
🔬This is a nightly-only experimental API. (field_projections #145383)
Expand description

Handle referring to a place behind an exclusive reference.

Implementations§

Source§

impl<'a, T: ?Sized> MutHandle<'a, T>

Source

pub const fn as_ptr(&self) -> *const T

🔬This is a nightly-only experimental API. (field_projections #145383)

Obtains a const raw pointer to the place.

Source

pub const fn as_mut_ptr(&self) -> *mut T

🔬This is a nightly-only experimental API. (field_projections #145383)

Obtains a mutable raw pointer to the place.

Source

pub const unsafe fn as_ref(&self) -> &'a T

🔬This is a nightly-only experimental API. (field_projections #145383)

Obtains a shared reference to the place.

Source

pub const unsafe fn as_mut(&mut self) -> &'a mut T

🔬This is a nightly-only experimental API. (field_projections #145383)

Obtains an exclusive reference to the place.

Trait Implementations§

Source§

impl<'a, T: ?Sized> Clone for MutHandle<'a, T>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)
where Self:,

Performs copy-assignment from source. Read more
Source§

impl<'a, T: ?Sized> Copy for MutHandle<'a, T>

Source§

impl<'a, T: ?Sized> Debug for MutHandle<'a, T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, 'b, T: ?Sized> DerefPlace for MutHandle<'b, &'a mut T>

Source§

type PointeeHandle = MutHandle<'a, T>

🔬This is a nightly-only experimental API. (field_projections #145383)
Source§

unsafe fn deref_place(self) -> Self::PointeeHandle

🔬This is a nightly-only experimental API. (field_projections #145383)
Source§

impl<'a, 'b, T: ?Sized> DerefPlace for MutHandle<'b, &'a T>

Source§

type PointeeHandle = RefHandle<'a, T>

🔬This is a nightly-only experimental API. (field_projections #145383)
Source§

unsafe fn deref_place(self) -> Self::PointeeHandle

🔬This is a nightly-only experimental API. (field_projections #145383)
Source§

impl<'a, T: ?Sized> PlaceHandle for MutHandle<'a, T>

Source§

type Target = T

🔬This is a nightly-only experimental API. (field_projections #145383)
Source§

impl<'a, S> ProjectPlace<S> for MutHandle<'a, S::Source>
where S: Subplace, S::Source: Sized, S::Target: Sized + 'a,

Source§

type Projected = MutHandle<'a, <S as Subplace>::Target>

🔬This is a nightly-only experimental API. (field_projections #145383)
Source§

unsafe fn project_place(self, subplace: S) -> Self::Projected

🔬This is a nightly-only experimental API. (field_projections #145383)

Auto Trait Implementations§

§

impl<'a, T> !Send for MutHandle<'a, T>

§

impl<'a, T> !Sync for MutHandle<'a, T>

§

impl<'a, T> !UnwindSafe for MutHandle<'a, T>

§

impl<'a, T> Forget for MutHandle<'a, T>
where T: ?Sized,

§

impl<'a, T> Freeze for MutHandle<'a, T>
where *const T is !null: Freeze, PhantomData<&'a mut T>: Freeze, T: ?Sized,

§

impl<'a, T> Move for MutHandle<'a, T>
where *const T is !null: Move, PhantomData<&'a mut T>: Move, T: ?Sized,

§

impl<'a, T> RefUnwindSafe for MutHandle<'a, T>
where T: RefUnwindSafe + ?Sized,

§

impl<'a, T> Unpin for MutHandle<'a, T>
where *const T is !null: Unpin, &'a mut T: Unpin, T: ?Sized,

§

impl<'a, T> UnsafeUnpin for MutHandle<'a, T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit #126799)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.