pub struct AppState {
pub source: Arc<dyn PrinterSource>,
pub controller: Arc<dyn Controller>,
pub files: Arc<dyn FileStore>,
pub starter: Arc<dyn Starter>,
pub password: Option<String>,
pub start_lock: Arc<Mutex<()>>,
pub external_cameras: Arc<RwLock<Vec<ExternalCamera>>>,
pub internal_camera: Arc<dyn CameraSource>,
pub timelapse: Arc<TimelapseManager>,
}Expand description
Shared server state.
Fields§
§source: Arc<dyn PrinterSource>§controller: Arc<dyn Controller>§files: Arc<dyn FileStore>§starter: Arc<dyn Starter>§password: Option<String>Optional password gating write (control) requests; None = control is
open. Reads are always unauthenticated.
start_lock: Arc<Mutex<()>>Held for the duration of a job/start so two concurrent starts can’t both
pass the idle check.
external_cameras: Arc<RwLock<Vec<ExternalCamera>>>External IP cameras the server proxies (single-JPEG-per-GET). Held
behind a lock so the dashboard can add/remove them at runtime
(/api/camera/config); seeded from --camera-url and in-memory only.
Proxied server-side so a browser that can’t reach the LAN cam (e.g. over
Tailscale) still gets a live view.
internal_camera: Arc<dyn CameraSource>The built-in (printer chamber) camera, grabbed over TCP:6000 in live
mode; NoCamera in fake / no-target mode.
timelapse: Arc<TimelapseManager>Serve-internal per-layer timelapse capture, driven off source’s status
feed and controlled at runtime by camera id. At most one runs at a time.