[][src]Struct abscissa_core::application::lock::Lock

pub struct Lock<A: Application>(_);

RwLock for accessing Application state.

Supports multiple concurrent readers (immutable-only) with an exclusive mutable writer.

Methods

impl<A: Application> Lock<A>[src]

pub fn new(app: A) -> Self[src]

Create a new lock around the given application

pub fn read(&'static self) -> Reader<A>[src]

Get the 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.

Auto Trait Implementations

impl<A> RefUnwindSafe for Lock<A>

impl<A> Send for Lock<A> where
    A: Send

impl<A> Sync for Lock<A> where
    A: Send + Sync

impl<A> Unpin for Lock<A> where
    A: Unpin

impl<A> UnwindSafe for Lock<A>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> AsAny for T where
    T: Any
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Erased for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.