Trait DerefPure

Source
pub unsafe trait DerefPure { }
🔬This is a nightly-only experimental API. (deref_pure_trait #87121)
Expand description

Perma-unstable marker trait. Indicates that the type has a well-behaved Deref (and, if applicable, DerefMut) implementation. This is relied on for soundness of deref patterns.

FIXME(deref_patterns): The precise semantics are undecided; the rough idea is that successive calls to deref/deref_mut without intermediate mutation should be idempotent, in the sense that they return the same value as far as pattern-matching is concerned. Calls to deref/deref_mut must leave the pointer itself likewise unchanged.

Implementors§

Source§

impl DerefPure for ByteStr

Source§

impl<Ptr: DerefPure> DerefPure for Pin<Ptr>

Source§

impl<T: ?Sized> DerefPure for &T

Source§

impl<T: ?Sized> DerefPure for &mut T

Source§

impl<T: ?Sized> DerefPure for Ref<'_, T>

Source§

impl<T: ?Sized> DerefPure for RefMut<'_, T>

Source§

impl<T: ?Sized> DerefPure for ManuallyDrop<T>

impl DerefPure for String

impl<B: ?Sized + ToOwned> DerefPure for Cow<'_, B>
where B::Owned: Borrow<B>,

impl<T, A: Allocator> DerefPure for Vec<T, A>

impl<T: ?Sized, A: Allocator> DerefPure for Box<T, A>

impl<T: ?Sized, A: Allocator> DerefPure for Rc<T, A>

impl<T: ?Sized, A: Allocator> DerefPure for UniqueRc<T, A>

impl<T: ?Sized, A: Allocator> DerefPure for Arc<T, A>