pub struct AppState {
pub xil_exe: PathBuf,
pub status: StatusFn,
pub(crate) jobs: Mutex<HashMap<u64, UnboundedReceiver<JobEvent>>>,
pub(crate) next_job: AtomicU64,
pub(crate) episodes_cache: Mutex<HashMap<PathBuf, (Instant, Rows)>>,
pub grade_cache: Mutex<BTreeMap<String, String>>,
pub(crate) choices: Mutex<Option<Arc<Choices>>>,
}Expand description
Everything a handler needs. Workspace paths are read from the environment on each call, as the Python module does.
Fields§
§xil_exe: PathBufThe xil executable stages run under.
status: StatusFn§jobs: Mutex<HashMap<u64, UnboundedReceiver<JobEvent>>>§next_job: AtomicU64§episodes_cache: Mutex<HashMap<PathBuf, (Instant, Rows)>>_EPISODES_CACHE: rows memoised per workspace root.
grade_cache: Mutex<BTreeMap<String, String>>_sfx_grade_cache: {path: grade}, rebuilt only on Load/Refresh.
choices: Mutex<Option<Arc<Choices>>>Implementations§
Source§impl AppState
impl AppState
pub fn new(xil_exe: PathBuf, status: StatusFn) -> Arc<AppState> ⓘ
Sourcepub fn choices(&self) -> Arc<Choices> ⓘ
pub fn choices(&self) -> Arc<Choices> ⓘ
The cached dropdown lists, built on first use. Blocking.
Sourcepub fn invalidate_choices(&self)
pub fn invalidate_choices(&self)
Drop the cached lists so the next request rebuilds them.
pub(crate) fn job_id(&self) -> u64
Auto Trait Implementations§
impl !Freeze for AppState
impl !RefUnwindSafe for AppState
impl !UnwindSafe for AppState
impl Send for AppState
impl Sync for AppState
impl Unpin for AppState
impl UnsafeUnpin for AppState
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