pub struct AppWorldWrapper<W: AppWorld> { /* private fields */ }Expand description
Holds application state and resources. See the crate level documentation for more details.
§Cloning
Cloning an AppWorldWrapper is a very cheap operation.
All clones hold pointers to the same inner state.
Implementations§
Source§impl<W: AppWorld + 'static> AppWorldWrapper<W>
impl<W: AppWorld + 'static> AppWorldWrapper<W>
Source§impl<W: AppWorld + 'static> AppWorldWrapper<W>
impl<W: AppWorld + 'static> AppWorldWrapper<W>
Sourcepub fn read(&self) -> WorldReadGuard<'_, W>
pub fn read(&self) -> WorldReadGuard<'_, W>
Acquire read access to AppWorld.
§Panics
Panics if the current thread is already holding a read guard.
This panic prevents the following scenario from deadlocking:
- Thread A acquires a read guard
- Thread B calls
AppWorld::msg, which attempts to acquire a write lock - Thread A attempts to acquire a second read guard while the first is still active
Trait Implementations§
Auto Trait Implementations§
impl<W> Freeze for AppWorldWrapper<W>
impl<W> RefUnwindSafe for AppWorldWrapper<W>
impl<W> Send for AppWorldWrapper<W>
impl<W> Sync for AppWorldWrapper<W>
impl<W> Unpin for AppWorldWrapper<W>
impl<W> UnwindSafe for AppWorldWrapper<W>
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