Skip to main content

DerefPure

Trait DerefPure 

Source
pub unsafe trait DerefPure { }
๐Ÿ”ฌThis is a nightly-only experimental API. (deref_pure_trait)
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.

Dyn Compatibilityยง

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementorsยง

Sourceยง

impl DerefPure for Cow<'_, str>

Available on non-no_global_oom_handling only.
Sourceยง

impl DerefPure for ByteStr

Sourceยง

impl DerefPure for ByteString

Sourceยง

impl DerefPure for String

Sourceยง

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

Sourceยง

impl<T> DerefPure for Cow<'_, [T]>
where T: Clone,

Available on non-no_global_oom_handling only.
Sourceยง

impl<T> DerefPure for Cow<'_, T>
where T: Clone,

Sourceยง

impl<T> DerefPure for &T
where T: ?Sized,

Sourceยง

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

Sourceยง

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

Sourceยง

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

Sourceยง

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

Sourceยง

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

Sourceยง

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

Sourceยง

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

Sourceยง

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

Sourceยง

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

Sourceยง

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