pub struct SingleThreadCell<T> { /* private fields */ }Expand description
A mutable memory location. Can only be accessed by the owner thread.
If you access the cell from a different thread, the thread will be panicked.
Implementations§
Trait Implementations§
Source§impl<T: Default> Default for SingleThreadCell<T>
impl<T: Default> Default for SingleThreadCell<T>
Source§impl<T> SingleThreadType for SingleThreadCell<T>
impl<T> SingleThreadType for SingleThreadCell<T>
Source§fn get_owner_thread_id(&self) -> ThreadId
fn get_owner_thread_id(&self) -> ThreadId
Get the owner thread that owns this type.
Source§fn check_thread_panic(&self)
fn check_thread_panic(&self)
Check the current thread and panic if not same.
fn check_same_thread(&self) -> bool
impl<T> Sync for SingleThreadCell<T>
Auto Trait Implementations§
impl<T> !Freeze for SingleThreadCell<T>
impl<T> !RefUnwindSafe for SingleThreadCell<T>
impl<T> Send for SingleThreadCell<T>where
T: Send,
impl<T> Unpin for SingleThreadCell<T>where
T: Unpin,
impl<T> UnwindSafe for SingleThreadCell<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more