pub struct StoreRouter { /* private fields */ }Expand description
Registers named SchedulerStore backends at host boot.
Thread-safe when accessed through Self::register_global / default_store_from_global;
direct mutation requires exclusive access to the router instance.
Implementations§
Source§impl StoreRouter
impl StoreRouter
Sourcepub fn register(
&mut self,
name: impl Into<String>,
store: Arc<dyn SchedulerStore>,
)
pub fn register( &mut self, name: impl Into<String>, store: Arc<dyn SchedulerStore>, )
Register a store under a logical name (overwrites any previous entry).
Sourcepub fn get(&self, name: &str) -> Option<Arc<dyn SchedulerStore>>
pub fn get(&self, name: &str) -> Option<Arc<dyn SchedulerStore>>
Resolve a registered store by name.
Sourcepub fn install_global(router: Self)
pub fn install_global(router: Self)
Replace the process-global router (typically once at startup).
Subsequent calls are ignored; the first successful install wins.
Sourcepub fn register_global(name: impl Into<String>, store: Arc<dyn SchedulerStore>)
pub fn register_global(name: impl Into<String>, store: Arc<dyn SchedulerStore>)
Register a store on the process-global router.
§Examples
StoreRouter::register_global(DEFAULT_STORE_NAME, store);Panics if the global router lock is poisoned.
Trait Implementations§
Source§impl Default for StoreRouter
impl Default for StoreRouter
Source§fn default() -> StoreRouter
fn default() -> StoreRouter
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for StoreRouter
impl !UnwindSafe for StoreRouter
impl Freeze for StoreRouter
impl Send for StoreRouter
impl Sync for StoreRouter
impl Unpin for StoreRouter
impl UnsafeUnpin for StoreRouter
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