Skip to main content

Crate single_thread_cell

Crate single_thread_cell 

Source
Expand description

This is a helper library to mark the cell as only being accessed by the owner thread.

If you access the cell from a different thread, the thread will be panicked.

The only exception is drop. The cell does not implement Send if T is not Send. So that the cell cannot be sent to another thread to drop. It is obvious that if T is Send, it is safe to drop in the other thread.

Re-exports§

pub use types::*;

Modules§

types

Structs§

SingleThreadCell
A mutable memory location. Can only be accessed by the owner thread.
SingleThreadRef
SingleThreadRefCell
SingleThreadRefMut