Struct wayland_commons::user_data::UserData [−][src]
pub struct UserData { /* fields omitted */ }
Expand description
A wrapper for user data, able to store any type, and correctly handling access from a wrong thread
Implementations
Sets the UserData to a given value
The provided closure is called to init the UserData, does nothing is the UserData had already been set.
Sets the UserData to a given threadsafe value
The provided closure is called to init the UserData, does nothing is the UserData had already been set.
Attempt to access the wrapped user data
Will return None
if either:
- The requested type
T
does not match the type used for construction - This
UserData
has been created using the non-threadsafe variant and access is attempted from an other thread than the one it was created on