pub struct AppContext {
pub db_context: DbContext,
pub event_hub: Arc<EventHub>,
pub shutdown_rx: Receiver<()>,
pub undo_redo_manager: Arc<Mutex<UndoRedoManager>>,
pub long_operation_manager: Arc<Mutex<LongOperationManager>>,
/* private fields */
}Expand description
Application context that holds all shared state.
Shutdown lifecycle: when AppContext::shutdown is called the shared
shutdown_tx is dropped, which makes every cloned shutdown_rx
(held by EventHubClient::start threads) see Disconnected on its
next recv() and exit. No polling and no atomic flag needed.
Fields§
§db_context: DbContext§event_hub: Arc<EventHub>§shutdown_rx: Receiver<()>Receiver clones are handed to background event-hub threads.
Threads exit when the matching sender is dropped via
AppContext::shutdown.
undo_redo_manager: Arc<Mutex<UndoRedoManager>>§long_operation_manager: Arc<Mutex<LongOperationManager>>Implementations§
Trait Implementations§
Source§impl Clone for AppContext
impl Clone for AppContext
Source§fn clone(&self) -> AppContext
fn clone(&self) -> AppContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AppContext
impl Debug for AppContext
Auto Trait Implementations§
impl !RefUnwindSafe for AppContext
impl !UnwindSafe for AppContext
impl Freeze for AppContext
impl Send for AppContext
impl Sync for AppContext
impl Unpin for AppContext
impl UnsafeUnpin for AppContext
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