pub struct Ctx {
pub home: Home,
pub store: Mutex<Store>,
pub backend: Arc<dyn CloneBackend>,
pub started_at: Instant,
pub room: Notify,
pub events_tx: Sender<EventRow>,
/* private fields */
}Fields§
§home: Home§store: Mutex<Store>§backend: Arc<dyn CloneBackend>§started_at: Instant§room: NotifyWoken whenever a clone goes away or the settings change, so queued creates look again.
events_tx: Sender<EventRow>Every event events::emit writes, for mitosis events --follow connections.
Implementations§
Source§impl Ctx
impl Ctx
pub fn open(home: Home, config: Config) -> Result<Ctx>
Sourcepub fn config(&self) -> Config
pub fn config(&self) -> Config
A snapshot of the current settings; a later reload does not change it.
pub fn set_config(&self, config: Config)
Sourcepub fn installs(&self) -> Vec<PgInstall>
pub fn installs(&self) -> Vec<PgInstall>
A snapshot of the known Postgres installs, newest first.
Sourcepub async fn install_major(&self, major: u32) -> Result<PgInstall>
pub async fn install_major(&self, major: u32) -> Result<PgInstall>
The install of major; on a miss the machine is searched once more before giving up.
Sourcepub async fn newest_install(&self) -> Result<PgInstall>
pub async fn newest_install(&self) -> Result<PgInstall>
The newest install; on a miss the machine is searched once more before giving up.
Sourcepub fn router(&self) -> MutexGuard<'_, RouterState>
pub fn router(&self) -> MutexGuard<'_, RouterState>
Locks the router state; never hold it across an await or a store call.
Sourcepub fn store(&self) -> MutexGuard<'_, Store>
pub fn store(&self) -> MutexGuard<'_, Store>
Locks the store; use it for one store call at a time, never across Postgres work.
Auto Trait Implementations§
impl !Freeze for Ctx
impl !RefUnwindSafe for Ctx
impl !UnwindSafe for Ctx
impl Send for Ctx
impl Sync for Ctx
impl Unpin for Ctx
impl UnsafeUnpin for Ctx
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