Skip to main content

SingleThread

Trait SingleThread 

Source
pub unsafe trait SingleThread { }
Expand description

A type T implements SingleThread if at any time there is a single thread from which all values/references to values of this type may be accessed.

Usually, it is sufficient that T is !Sync and Singleton.

Since Sending T denies access in the original thread, this property is maintained regardless of Sendability.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<'a, T: SingleThread> SingleThread for &'a T

Source§

impl<'a, T: SingleThread> SingleThread for &'a mut T

Source§

impl<T: SingleThread> SingleThread for [T; 1]

Source§

impl<T: SingleThread> SingleThread for Cell<T>

Implementors§