[][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.


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

impl<T> AsAny for T where
    T: Any

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> Erased for T

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

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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

The type returned in the event of a conversion error.