Lines Matching refs:UniquePtr
15 pub struct UniquePtr<T>
23 impl<T> UniquePtr<T>
27 /// Makes a new UniquePtr wrapping a null pointer.
31 UniquePtr {
37 /// Allocates memory on the heap and makes a UniquePtr pointing to it.
42 UniquePtr {
48 /// Checks whether the UniquePtr does not own an object.
56 /// Returns a reference to the object owned by this UniquePtr if any,
62 /// Returns a mutable pinned reference to the object owned by this UniquePtr
72 /// UniquePtr.
76 /// Panics if the UniquePtr holds a null pointer.
81 "called pin_mut on a null UniquePtr<{}>",
87 /// Consumes the UniquePtr, releasing its ownership of the heap-allocated T.
96 /// Constructs a UniquePtr retaking ownership of a pointer previously
105 UniquePtr {
112 unsafe impl<T> Send for UniquePtr<T> where T: Send + UniquePtrTarget {}
113 unsafe impl<T> Sync for UniquePtr<T> where T: Sync + UniquePtrTarget {}
115 // UniquePtr is not a self-referential type and is safe to move out of a Pin,
117 impl<T> Unpin for UniquePtr<T> where T: UniquePtrTarget {}
119 impl<T> Drop for UniquePtr<T>
128 impl<T> Deref for UniquePtr<T>
138 "called deref on a null UniquePtr<{}>",
145 impl<T> DerefMut for UniquePtr<T>
153 "called deref_mut on a null UniquePtr<{}>",
160 impl<T> Debug for UniquePtr<T>
172 impl<T> Display for UniquePtr<T>
185 /// `UniquePtr<T>` in generic code.
193 /// [`UniquePtr`] in generic code.
196 /// use cxx::memory::{UniquePtr, UniquePtrTarget};
199 /// pub fn take_generic_ptr<T>(ptr: UniquePtr<T>)