pub struct UncheckedSyncSend<T: ?Sized>(/* private fields */);Expand description
A wrapper that implements Sync and Send, even when T doesn’t.
This type is unsafe to construct, and doesn’t have any checks for whether your usage of the type is actually thread-safe.
Access to the inner value is provided via the Deref/DerefMut traits,
and via the into_inner method.
See the crate-level-docs for more information.
Implementations§
Source§impl<T> UncheckedSyncSend<T>
impl<T> UncheckedSyncSend<T>
Sourcepub const unsafe fn new(value: T) -> Self
pub const unsafe fn new(value: T) -> Self
Constructs a new instance of UncheckedSyncSend which will wrap the
specified value.
Note that this function is unsafe, while all other API of
UncheckedSyncSend is safe.
§Safety
All subsequent uses of the constructed UncheckedSyncSend must be
thread-safe.
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Unwraps the UncheckedSyncSend, consuming it.
Trait Implementations§
Source§impl<T: Copy> Clone for UncheckedSyncSend<T>
UncheckedSyncSend implements Clone only when T is Copy, not when T
is Clone. This impl is provided because it is required for the Copy
impl.
impl<T: Copy> Clone for UncheckedSyncSend<T>
UncheckedSyncSend implements Clone only when T is Copy, not when T
is Clone. This impl is provided because it is required for the Copy
impl.
Source§impl<T: ?Sized> Deref for UncheckedSyncSend<T>
impl<T: ?Sized> Deref for UncheckedSyncSend<T>
Source§impl<T: ?Sized> DerefMut for UncheckedSyncSend<T>
impl<T: ?Sized> DerefMut for UncheckedSyncSend<T>
impl<T: Copy> Copy for UncheckedSyncSend<T>
This impl is provided because, without it, it would be impossible for a
struct containing an UncheckedSyncSend to implement Copy.