Struct wayland_commons::ThreadGuard [−][src]
pub struct ThreadGuard<T: ?Sized> { /* fields omitted */ }
Expand description
Stores a value in a threadafe container that only lets you access it from its owning thread
If the ThreadGuard is dropped from the wrong thread, the underlying value will be leaked.
Implementations
Create a new ThreadGuard wrapper
Mutably access the underlying value
Panics if done on the wrong thread
Try to access the underlying value
Returns None
if done on the wrong thread
Try to mutably access the underlying value
Returns None
if done on the wrong thread