pub struct UniquePtr<T>where
T: UniquePtrTarget,
{ /* private fields */ }Expand description
Binding to C++ std::unique_ptr<T, std::default_delete<T>>.
Source§
Source
Makes a new UniquePtr wrapping a null pointer.
Matches the behavior of default-constructing a std::unique_ptr.
Source
Allocates memory on the heap and makes a UniquePtr pointing to it.
Source
Returns a reference to the object owned by this UniquePtr if any, otherwise None.
Source
Returns a mutable pinned reference to the object owned by this UniquePtr if any, otherwise None.
Source
Returns a mutable pinned reference to the object owned by this UniquePtr.
§Panics
Panics if the UniquePtr holds a null pointer.
Source
Returns a raw const pointer to the object owned by this UniquePtr if any, otherwise the null pointer.
Source
Returns a raw mutable pointer to the object owned by this UniquePtr if any, otherwise the null pointer.
As with std::unique_ptr<T>::get, this doesn’t require that you hold an exclusive reference to the UniquePtr. This differs from Rust norms, so extra care should be taken in the way the pointer is used.
Source§
Source§Available on crate feature std only.
Forwarding Read trait implementation in a manner similar to Box<T>.
Available on crate feature std only.
Forwarding Read trait implementation in a manner similar to Box<T>.
Note that the implementation will panic for null UniquePtr<T>.
Source§
Pull some bytes from this source into the specified buffer, returning how many bytes were read. Read more
Source§
🔬This is a nightly-only experimental API. (can_vector)
Determines if this Reader has an efficient read_vectored
implementation. Read more
Source§
🔬This is a nightly-only experimental API. (read_buf)
Pull some bytes from this source into the specified buffer. Read more
Source§Available on crate feature std only.
Forwarding Seek trait implementation in a manner similar to Box<T>.
Available on crate feature std only.
Forwarding Seek trait implementation in a manner similar to Box<T>.
Note that the implementation will panic for null UniquePtr<T>.
Source§Available on crate feature std only.
Forwarding Write trait implementation in a manner similar to Box<T>.
Available on crate feature std only.
Forwarding Write trait implementation in a manner similar to Box<T>.
Note that the implementation will panic for null UniquePtr<T>.