Struct core::ptr::Shared
[−]
[src]
pub struct Shared<T: ?Sized> { pointer: NonZero<*const T>, _marker: PhantomData<T>, }
A wrapper around a raw *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.
Fields
pointer | |
_marker |
Methods
impl<T: ?Sized> Shared<T>
Trait Implementations
impl<T: ?Sized> !Send for Shared<T>
Shared
pointers are not Send
because the data they reference may be aliased.
impl<T: ?Sized> !Sync for Shared<T>
Shared
pointers are not Sync
because the data they reference may be aliased.