[−][src]Struct abscissa_core::application::lock::Lock
RwLock
for accessing global Application
state.
Supports multiple concurrent readers (immutable-only) with an exclusive mutable writer.
Methods
impl<A: Application> Lock<A>
[src]
pub fn read(&'static self) -> Reader<A>
[src]
Get the global application state, acquiring a shared, read-only lock around it which permits concurrent access by multiple readers.
If the application has not yet been initialized, calls not_loaded()
.
pub fn write(&'static self) -> Writer<A>
[src]
Obtain an exclusive lock on the application state, allowing it to be accessed mutably.
pub fn set(&self, new_app: A)
[src]
Set the global application state to the given value
Trait Implementations
impl<A> Default for Lock<A> where
A: Application,
[src]
A: Application,
Auto Trait Implementations
impl<A> Unpin for Lock<A> where
A: Unpin,
A: Unpin,
impl<A> Sync for Lock<A> where
A: Send + Sync,
A: Send + Sync,
impl<A> Send for Lock<A> where
A: Send,
A: Send,
impl<A> UnwindSafe for Lock<A>
impl<A> RefUnwindSafe for Lock<A>
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,