Struct std::ptr::Shared [] [src]

pub struct Shared<T> where T: ?Sized { /* fields omitted */ }
🔬 This is a nightly-only experimental API.   (shared)

needs an RFC to flesh out design

A wrapper around a raw non-null *mut T that indicates that the possessor of this wrapper has shared ownership of the referent. Useful for building abstractions like Rc<T> or Arc<T>, which internally use raw pointers to manage the memory that they own.

Methods

impl<T> Shared<T> where T: ?Sized
[src]

🔬 This is a nightly-only experimental API.   (shared)

Creates a new Shared.

Safety

ptr must be non-null.

Trait Implementations

impl<T> Deref for Shared<T> where T: ?Sized
[src]

The resulting type after dereferencing

The method called to dereference a value

impl<T> !Sync for Shared<T> where T: ?Sized
[src]

Shared pointers are not Sync because the data they reference may be aliased.

impl<T> !Send for Shared<T> where T: ?Sized
[src]

Shared pointers are not Send because the data they reference may be aliased.

impl<T> Clone for Shared<T> where T: ?Sized
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T, U> CoerceUnsized<Shared<U>> for Shared<T> where T: Unsize<U> + ?Sized,
        U: ?Sized
[src]

impl<T> Copy for Shared<T> where T: ?Sized
[src]

impl<T> Pointer for Shared<T>
[src]

Formats the value using the given formatter.