Skip to main content

Send

Trait Send 

1.0.0 · Source
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 Rcs 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.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

1.26.0 · Source§

impl !Send for Args

1.26.0 · Source§

impl !Send for ArgsOs

1.0.0 · Source§

impl !Send for Arguments<'_>

Source§

impl !Send for LocalWaker

1.98.0 · Source§

impl !Send for VarsOs

Source§

impl Send for Atom

Immutable, so it’s safe to be shared between threads

Source§

impl Send for bytes::bytes::Bytes

Source§

impl Send for core::ffi::c_str::Bytes<'_>

Source§

impl Send for BytesMut

Source§

impl Send for DIR

1.6.0 · Source§

impl Send for alloc::string::Drain<'_>

1.10.0 · Source§

impl Send for Location<'_>

1.0.0 · Source§

impl Send for TypeId

1.36.0 · Source§

impl Send for Waker

Source§

impl Send for Wtf8Atom

Immutable, so it’s safe to be shared between threads

§

impl<'a, 'b, K, Q, V, S, A> Send for OccupiedEntryRef<'a, 'b, K, Q, V, S, A>
where K: Send, Q: Sync + ?Sized, V: Send, S: Send, A: Send + Allocator,

Source§

impl<'a, R, T> Send for lock_api::mutex::MappedMutexGuard<'a, R, T>
where R: RawMutex + 'a, T: Send + 'a + ?Sized, <R as RawMutex>::GuardMarker: Send,

Source§

impl<'a, R, T> Send for lock_api::rwlock::MappedRwLockReadGuard<'a, R, T>
where R: RawRwLock + 'a, T: Sync + 'a + ?Sized, <R as RawRwLock>::GuardMarker: Send,

Source§

impl<'a, R, T> Send for lock_api::rwlock::MappedRwLockWriteGuard<'a, R, T>
where R: RawRwLock + 'a, T: Send + 'a + ?Sized, <R as RawRwLock>::GuardMarker: Send,

Source§

impl<'a, T, O> Send for bitvec::slice::iter::Iter<'a, T, O>
where T: BitStore, O: BitOrder, &'a mut BitSlice<T, O>: Send,

Source§

impl<'a, T, O> Send for bitvec::slice::iter::IterMut<'a, T, O>
where T: BitStore, O: BitOrder, &'a mut BitSlice<T, O>: Send,

Source§

impl<'a, T> Send for ArcBorrow<'a, T>
where T: Sync + Send + ?Sized,

Source§

impl<'a, T> Send for smallvec::Drain<'a, T>
where T: Send + Array,

Source§

impl<'a, T> Send for ZeroVec<'a, T>
where T: AsULE, <T as AsULE>::ULE: Send + Sync,

1.44.0 · Source§

impl<'a> Send for IoSlice<'a>

1.44.0 · Source§

impl<'a> Send for IoSliceMut<'a>

Source§

impl<A, B> Send for ArcUnion<A, B>
where A: Sync + Send, B: Send + Sync,

Source§

impl<A> Send for SmallVec<A>
where A: Array, <A as Array>::Item: Send,

Source§

impl<C> Send for CartableOptionPointer<C>

Source§

impl<Dyn> Send for DynMetadata<Dyn>
where Dyn: ?Sized,

Source§

impl<H, T> Send for ThinArc<H, T>
where H: Sync + Send, T: Sync + Send,

§

impl<K, V, S, A> Send for OccupiedEntry<'_, K, V, S, A>
where K: Send, V: Send, S: Send, A: Send + Allocator,

§

impl<K, V, S, A> Send for RawOccupiedEntryMut<'_, K, V, S, A>
where K: Send, V: Send, S: Send, A: Send + Allocator,

§

impl<K, V> Send for IterMut<'_, K, V>
where K: Send, V: Send,

Source§

impl<M, T, O> Send for BitRef<'_, M, T, O>
where M: Mutability, T: BitStore + Sync, O: BitOrder,

Source§

impl<R, G, T> Send for ReentrantMutex<R, G, T>
where R: RawMutex + Send, G: GetThreadId + Send, T: Send + ?Sized,

Source§

impl<R, G> Send for RawReentrantMutex<R, G>
where R: RawMutex + Send, G: GetThreadId + Send,

Source§

impl<R, T> Send for lock_api::mutex::Mutex<R, T>
where R: RawMutex + Send, T: Send + ?Sized,

Source§

impl<R, T> Send for lock_api::rwlock::RwLock<R, T>
where R: RawRwLock + Send, T: Send + ?Sized,

1.0.0 · Source§

impl<T, A> !Send for Rc<T, A>
where A: Allocator, T: ?Sized,

Source§

impl<T, A> !Send for UniqueRc<T, A>
where A: Allocator, T: ?Sized,

1.4.0 · Source§

impl<T, A> !Send for alloc::rc::Weak<T, A>
where A: Allocator, T: ?Sized,

1.0.0 · Source§

impl<T, A> Send for swc_common::sync::Lrc<T, A>
where T: Sync + Send + ?Sized, A: Allocator + Send,

§

impl<T, A> Send for Box<T, A>
where A: Allocator + Send, T: Send + ?Sized,

Source§

impl<T, A> Send for Cursor<'_, T, A>
where T: Sync, A: Allocator + Sync,

Source§

impl<T, A> Send for CursorMut<'_, T, A>
where T: Send, A: Allocator + Send,

1.6.0 · Source§

impl<T, A> Send for alloc::collections::vec_deque::drain::Drain<'_, T, A>
where T: Send, A: Allocator + Send,

1.6.0 · Source§

impl<T, A> Send for alloc::vec::drain::Drain<'_, T, A>
where T: Send, A: Send + Allocator,

§

impl<T, A> Send for Drain<'_, T, A>
where T: Send, A: Send + Allocator,

1.0.0 · Source§

impl<T, A> Send for alloc::vec::into_iter::IntoIter<T, A>
where T: Send, A: Allocator + Send,

§

impl<T, A> Send for IntoIter<T, A>
where T: Send, A: Allocator + Send,

1.0.0 · Source§

impl<T, A> Send for LinkedList<T, A>
where T: Send, A: Allocator + Send,

§

impl<T, A> Send for OccupiedEntry<'_, T, A>
where T: Send, A: Send + Allocator,

§

impl<T, A> Send for RawDrain<'_, T, A>
where A: Allocator + Send, T: Send,

§

impl<T, A> Send for RawIntoIter<T, A>
where A: Allocator + Send, T: Send,

§

impl<T, A> Send for RawTable<T, A>
where A: Allocator + Send, T: Send,

Source§

impl<T, A> Send for alloc::sync::UniqueArc<T, A>
where T: Sync + Send + ?Sized, A: Allocator + Send,

1.4.0 · Source§

impl<T, A> Send for alloc::sync::Weak<T, A>
where T: Sync + Send + ?Sized, A: Allocator + Send,

Source§

impl<T, O> Send for BitBox<T, O>
where T: BitStore, O: BitOrder,

Source§

impl<T, O> Send for BitSlice<T, O>
where T: BitStore + Sync, O: BitOrder,

§Bit-Slice Thread Safety

This allows bit-slice references to be moved across thread boundaries only when the underlying T element can tolerate concurrency.

All BitSlice references, shared or exclusive, are only threadsafe if the T element type is Send, because any given bit-slice reference may only have partial control of a memory element that is also being shared by a bit-slice reference on another thread. As such, this is never implemented for Cell<U>, but always implemented for AtomicU and U for a given unsigned integer type U.

Atomic integers safely handle concurrent writes, cells do not allow concurrency at all, so the only missing piece is &mut BitSlice<_, U: Unsigned>. This is handled by the aliasing system that the mutable splitters employ: a mutable reference to an unsynchronized bit-slice can only cross threads when no other handle is able to exist to the elements it governs. Splitting a mutable bit-slice causes the split halves to change over to either atomics or cells, so concurrency is either safe or impossible.

Source§

impl<T, O> Send for BitVec<T, O>
where T: BitStore, O: BitOrder,

Source§

impl<T, O> Send for bitvec::vec::iter::Drain<'_, T, O>
where T: BitStore, O: BitOrder, &'a mut BitSlice<T, O>: for<'a> Send,

Source§

impl<T, O> Send for bitvec::boxed::iter::IntoIter<T, O>
where T: BitStore + Sync, O: BitOrder,

1.0.0 · Source§

impl<T> !Send for *const T
where T: ?Sized,

1.0.0 · Source§

impl<T> !Send for *mut T
where T: ?Sized,

Source§

impl<T> !Send for std::sync::nonpoison::mutex::MappedMutexGuard<'_, T>
where T: ?Sized,

Source§

impl<T> !Send for std::sync::poison::mutex::MappedMutexGuard<'_, T>
where T: ?Sized,

Source§

impl<T> !Send for std::sync::nonpoison::rwlock::MappedRwLockReadGuard<'_, T>
where T: ?Sized,

Source§

impl<T> !Send for std::sync::poison::rwlock::MappedRwLockReadGuard<'_, T>
where T: ?Sized,

Source§

impl<T> !Send for std::sync::nonpoison::rwlock::MappedRwLockWriteGuard<'_, T>
where T: ?Sized,

Source§

impl<T> !Send for std::sync::poison::rwlock::MappedRwLockWriteGuard<'_, T>
where T: ?Sized,

Source§

impl<T> !Send for std::sync::nonpoison::mutex::MutexGuard<'_, T>
where T: ?Sized,

A MutexGuard is not Send to maximize platform portability.

On platforms that use POSIX threads (commonly referred to as pthreads) there is a requirement to release mutex locks on the same thread they were acquired. For this reason, MutexGuard must not implement Send to prevent it being dropped from another thread.

1.0.0 · Source§

impl<T> !Send for std::sync::poison::mutex::MutexGuard<'_, T>
where T: ?Sized,

A MutexGuard is not Send to maximize platform portability.

On platforms that use POSIX threads (commonly referred to as pthreads) there is a requirement to release mutex locks on the same thread they were acquired. For this reason, MutexGuard must not implement Send to prevent it being dropped from another thread.

1.25.0 · Source§

impl<T> !Send for NonNull<T>
where T: ?Sized,

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

Source§

impl<T> !Send for ReentrantLockGuard<'_, T>
where T: ?Sized,

Source§

impl<T> !Send for std::sync::nonpoison::rwlock::RwLockReadGuard<'_, T>
where T: ?Sized,

1.0.0 · Source§

impl<T> !Send for std::sync::poison::rwlock::RwLockReadGuard<'_, T>
where T: ?Sized,

Source§

impl<T> !Send for std::sync::nonpoison::rwlock::RwLockWriteGuard<'_, T>
where T: ?Sized,

1.0.0 · Source§

impl<T> !Send for std::sync::poison::rwlock::RwLockWriteGuard<'_, T>
where T: ?Sized,

1.0.0 · Source§

impl<T> Send for &T
where T: Sync + ?Sized,

Source§

impl<T> Send for triomphe::arc::Arc<T>
where T: Sync + Send + ?Sized,

1.0.0 · Source§

impl<T> Send for Atomic<T>
where T: AtomicPrimitive,

Source§

impl<T> Send for BitSpanError<T>
where T: BitStore,

§

impl<T> Send for Bucket<T>

1.0.0 · Source§

impl<T> Send for Cell<T>
where T: Send + ?Sized,

1.31.0 · Source§

impl<T> Send for ChunksExactMut<'_, T>
where T: Send,

1.0.0 · Source§

impl<T> Send for ChunksMut<'_, T>
where T: Send,

1.0.0 · Source§

impl<T> Send for core::slice::iter::Iter<'_, T>
where T: Sync,

1.0.0 · Source§

impl<T> Send for alloc::collections::linked_list::Iter<'_, T>
where T: Sync,

1.0.0 · Source§

impl<T> Send for core::slice::iter::IterMut<'_, T>
where T: Send,

1.0.0 · Source§

impl<T> Send for alloc::collections::linked_list::IterMut<'_, T>
where T: Send,

1.29.0 · Source§

impl<T> Send for JoinHandle<T>

Source§

impl<T> Send for MisalignError<T>

Source§

impl<T> Send for std::sync::nonpoison::mutex::Mutex<T>
where T: Send + ?Sized,

T must be Send for a Mutex to be Send because it is possible to acquire the owned T from the Mutex via into_inner.

1.0.0 · Source§

impl<T> Send for std::sync::poison::mutex::Mutex<T>
where T: Send + ?Sized,

T must be Send for a Mutex to be Send because it is possible to acquire the owned T from the Mutex via into_inner.

1.28.0 · Source§

impl<T> Send for NonZero<T>

Source§

impl<T> Send for OffsetArc<T>
where T: Sync + Send + ?Sized,

1.70.0 · Source§

impl<T> Send for OnceLock<T>
where T: Send,

Source§

impl<T> Send for Out<'_, T>
where T: Send,

1.31.0 · Source§

impl<T> Send for RChunksExactMut<'_, T>
where T: Send,

1.31.0 · Source§

impl<T> Send for RChunksMut<'_, T>
where T: Send,

Source§

impl<T> Send for std::sync::mpmc::Receiver<T>
where T: Send,

1.0.0 · Source§

impl<T> Send for std::sync::mpsc::Receiver<T>
where T: Send,

Source§

impl<T> Send for ReentrantLock<T>
where T: Send + ?Sized,

1.0.0 · Source§

impl<T> Send for RefCell<T>
where T: Send + ?Sized,

Source§

impl<T> Send for std::sync::nonpoison::rwlock::RwLock<T>
where T: Send + ?Sized,

1.0.0 · Source§

impl<T> Send for std::sync::poison::rwlock::RwLock<T>
where T: Send + ?Sized,

Source§

impl<T> Send for std::sync::mpmc::Sender<T>
where T: Send,

1.0.0 · Source§

impl<T> Send for std::sync::mpsc::Sender<T>
where T: Send,

1.0.0 · Source§

impl<T> Send for SyncSender<T>
where T: Send,

Source§

impl<T> Send for ThinBox<T>
where T: Send + ?Sized,

ThinBox<T> is Send if T is Send because the data is owned.

Source§

impl<T> Send for triomphe::unique_arc::UniqueArc<T>
where T: Send + ?Sized,

Auto implementors§

§

impl !Send for SingleThreadedComments

§

impl Send for Alignment

§

impl Send for Applicability

§

impl Send for BytePos

§

impl Send for ByteToCharPosState

§

impl Send for CharPos

§

impl Send for CodeSuggestion

§

impl Send for ColorConfig

§

impl Send for Comment

§

impl Send for CommentKind

§

impl Send for Context

§

impl Send for DebugAsHex

§

impl Send for DefaultSourceMapGenConfig

§

impl Send for Destination

§

impl Send for Diagnostic

§

impl Send for DiagnosticId

§

impl Send for DiagnosticStyledString

§

impl Send for DistinctSources

§

impl Send for EmitterWriter

§

impl Send for Error

§

impl Send for ExplicitBug

§

impl Send for FatalError

§

impl Send for FatalErrorMarker

§

impl Send for FileLines

§

impl Send for FileName

§

impl Send for FilePathMapping

§

impl Send for FilePos

§

impl Send for FormattingOptions

§

impl Send for Globals

§

impl Send for Handler

§

impl Send for HandlerFlags

§

impl Send for Level

§

impl Send for LineCol

§

impl Send for LineInfo

§

impl Send for Loc

§

impl Send for LocWithOpt

§

impl Send for MalformedSourceMapPositions

§

impl Send for Mark

§

impl Send for Message

§

impl Send for MultiByteChar

§

impl Send for MultiSpan

§

impl Send for MutableMarkContext

§

impl Send for NonNarrowChar

§

impl Send for NoopComments

§

impl Send for PartialFileLines

§

impl Send for PartialLoc

§

impl Send for PluginCorePkgDiagnostics

§

impl Send for PluginEmitOutput

§

impl Send for PrimarySpanLabel

§

impl Send for RealFileLoader

§

impl Send for Sign

§

impl Send for SourceFile

§

impl Send for SourceFileAnalysis

§

impl Send for SourceFileAndBytePos

§

impl Send for SourceFileAndLine

§

impl Send for SourceMap

§

impl Send for SourceMapLookupError

§

impl Send for Span

§

impl Send for SpanLabel

§

impl Send for SpanLinesError

§

impl Send for SpanSnippetError

§

impl Send for StableSourceFileId

§

impl Send for Style

§

impl Send for SubDiagnostic

§

impl Send for Substitution

§

impl Send for SubstitutionPart

§

impl Send for SyntaxContext

§

impl Send for TransformPluginMetadataContext

§

impl Send for TransformPluginMetadataContextKind

§

impl Send for Type

§

impl<'a, 'b> !Send for DebugList<'a, 'b>

§

impl<'a, 'b> !Send for DebugMap<'a, 'b>

§

impl<'a, 'b> !Send for DebugSet<'a, 'b>

§

impl<'a, 'b> !Send for DebugStruct<'a, 'b>

§

impl<'a, 'b> !Send for DebugTuple<'a, 'b>

§

impl<'a, K> Send for AstKindPathGuard<'a, K>
where K: Send,

§

impl<'a, K> Send for AstKindPathIndexGuard<'a, K>
where K: Send,

§

impl<'a, N> Send for AstNodePathGuard<'a, N>
where N: Send, <N as NodeRef>::ParentKind: Send,

§

impl<'a, N> Send for AstNodePathIndexGuard<'a, N>
where N: Send, <N as NodeRef>::ParentKind: Send,

§

impl<'a> !Send for Formatter<'a>

§

impl<'a> Send for DiagnosticBuilder<'a>

§

impl<'a> Send for StringInput<'a>

§

impl<'a> Send for WritableDst<'a>

§

impl<B, F, I> Send for ChainWith<B, F, I>
where B: Send, F: Send, I: Send,

§

impl<F> Send for FromFn<F>
where F: Send,

§

impl<It> Send for swc_common::iter::Iter<It>
where It: Send, <It as Iterator>::Item: Send,

§

impl<K> Send for AstKindPath<K>
where K: Send,

§

impl<L, R> Send for Either<L, R>
where L: Send, R: Send,

§

impl<N> Send for AstNodePath<N>
where N: Send, <N as NodeRef>::ParentKind: Send,

§

impl<T, F> Send for Lazy<T, F>
where T: Send, F: Send,

§

impl<T> Send for CacheCell<T>
where T: Send,

§

impl<T> Send for Lock<T>
where T: Send,

§

impl<T> Send for LockCell<T>
where T: Send,

§

impl<T> Send for Node<T>
where T: Send,

§

impl<T> Send for OnceCell<T>
where T: Send,

§

impl<T> Send for swc_common::sync::RwLock<T>
where T: Send,

§

impl<V> Send for All<V>
where V: Send,

§

impl<V> Send for Optional<V>
where V: Send,

§

impl<V> Send for Repeat<V>
where V: Send,