Trait swc_common::sync::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 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 for more details.
Implementations on Foreign Types
impl<'de, T: ?Sized> Send for Borrowed<'de, T> where
T: Sync,
impl<'a, E> Send for StrDeserializer<'a, E> where
E: Send,
impl<'de, E> Send for BorrowedStrDeserializer<'de, E> where
E: Send,
impl<'a, 'de, E> Send for FlatMapDeserializer<'a, 'de, E> where
E: Send,
impl<'a, 'de, E> Send for FlatMapAccess<'a, 'de, E> where
E: Send,
impl<'a, 'de, E> Send for FlatStructAccess<'a, 'de, E> where
E: Send,
impl<'a, 'de, E> Send for FlatInternallyTaggedAccess<'a, 'de, E> where
E: Send,
impl<'de> Send for Content<'de>
impl<'de, E> Send for ContentDeserializer<'de, E> where
E: Send,
impl<'a, 'de, E> Send for ContentRefDeserializer<'a, 'de, E> where
E: Send,
impl<'de, E> Send for EnumDeserializer<'de, E> where
E: Send,
impl<'a> Send for InternallyTaggedUnitVisitor<'a>
impl Send for TagContentOtherField
impl Send for TagContentOtherFieldVisitor
impl Send for TagOrContentField
impl Send for TagOrContentFieldVisitor
impl<'de, T> Send for TaggedContentVisitor<'de, T> where
T: Send,
impl<'a> Send for UntaggedUnitVisitor<'a>
impl<'a, T> Send for InPlaceSeed<'a, T> where
T: Send,
impl<'a, M> Send for FlatMapSerializer<'a, M> where
M: Send,
impl<'a, M> Send for FlatMapSerializeMap<'a, M> where
M: Send,
impl<'a, M> Send for FlatMapSerializeStruct<'a, M> where
M: Send,
impl<'a, M> Send for FlatMapSerializeStructVariantAsMapValue<'a, M> where
M: Send,
impl Send for Argument
impl Send for FormatSpec
impl Send for Alignment
impl Send for Count
impl Send for Alignment
impl Send for Error
impl<'a> !Send for Arguments<'a>
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> !Send for Formatter<'a>
impl<T: ?Sized> Send for PhantomData<T> where
T: Send,
impl<T> Send for Option<T> where
T: Send,
impl<T, E> Send for Result<T, E> where
E: Send,
T: Send,
impl<T, A> Send for Vec<T, A> where
A: Send,
T: Send,
impl<T> Send for RwLock<T> where
T: Send + ?Sized,
impl<'_> Send for BorrowedHandle<'_>
impl Send for Once
impl<'_, T> !Send for MutexGuard<'_, T> where
T: ?Sized,
impl<'_, T> !Send for RwLockReadGuard<'_, T> where
T: ?Sized,
impl<T> Send for Mutex<T> where
T: Send + ?Sized,
impl<'a> Send for IoSliceMut<'a>
impl<T> Send for SyncSender<T> where
T: Send,
impl<T> Send for Sender<T> where
T: Send,
impl !Send for Args
impl Send for HandleOrInvalid
impl<T> Send for SyncOnceCell<T> where
T: Send,
impl<'_, T> !Send for RwLockWriteGuard<'_, T> where
T: ?Sized,
impl Send for HandleOrNull
impl<T> Send for JoinHandle<T>
impl<'a> Send for IoSlice<'a>
impl !Send for ArgsOs
impl Send for OwnedHandle
impl<T> Send for Receiver<T> where
T: Send,
impl<'_, T> Send for &'_ mut T where
T: Send + ?Sized,
impl<T> !Send for *const T where
T: ?Sized,
impl<'_, T> Send for Iter<'_, T> where
T: Sync,
impl<T> Send for RefCell<T> where
T: Send + ?Sized,
impl<T> Send for AtomicPtr<T>
impl<T> !Send for NonNull<T> where
T: ?Sized,
NonNull
pointers are not Send
because the data they reference may be aliased.