pub unsafe auto trait Send { }
Expand description
Types that can be transferred across thread boundaries.
This trait is automatically implemented when the compiler determines it’s appropriate.
An example of a non-Send
type is the reference-counting pointer
rc::Rc
. If two threads attempt to clone Rc
s that point to the same
reference-counted value, they might try to update the reference count at the
same time, which is undefined behavior because Rc
doesn’t use atomic
operations. Its cousin sync::Arc
does use atomic operations (incurring
some overhead) and thus is Send
.
See the Nomicon and the Sync
trait for more details.
Implementors§
impl !Send for LocalWaker
impl Send for Waker
impl<Dyn: ?Sized> Send for DynMetadata<Dyn>
impl<T> Send for Cell<T>
impl<T> Send for RefCell<T>
impl<T> Send for NonZero<T>where
T: ZeroablePrimitive + Send,
impl<T> Send for ChunksExactMut<'_, T>where
T: Send,
impl<T> Send for ChunksMut<'_, T>where
T: Send,
impl<T> Send for RChunksExactMut<'_, T>where
T: Send,
impl<T> Send for RChunksMut<'_, T>where
T: Send,
impl<T> Send for AtomicPtr<T>
impl<T: Send> Send for core::slice::IterMut<'_, T>
impl<T: Sync + ?Sized> Send for &T
impl<T: Sync> Send for core::slice::Iter<'_, T>
impl<T: ?Sized> !Send for *const T
impl<T: ?Sized> !Send for *mut T
impl<T: ?Sized> !Send for NonNull<T>
NonNull
pointers are not Send
because the data they reference may be aliased.