kvarn_async::prelude::compact_str::core::cell

Struct SyncUnsafeCell

source
pub struct SyncUnsafeCell<T>
where T: ?Sized,
{ /* private fields */ }
🔬This is a nightly-only experimental API. (sync_unsafe_cell)
Expand description

UnsafeCell, but Sync.

This is just an UnsafeCell, except it implements Sync if T implements Sync.

UnsafeCell doesn’t implement Sync, to prevent accidental mis-use. You can use SyncUnsafeCell instead of UnsafeCell to allow it to be shared between threads, if that’s intentional. Providing proper synchronization is still the task of the user, making this type just as unsafe to use.

See UnsafeCell for details.

Implementations§