pub struct AppStateInner {
pub service: Arc<CameraService>,
}Expand description
The state behind AppState.
Fields§
§service: Arc<CameraService>The cameras.
Implementations§
Source§impl AppStateInner
impl AppStateInner
Sourcepub fn new(service: Arc<CameraService>) -> AppState
pub fn new(service: Arc<CameraService>) -> AppState
State for a service, with alarm tracking started if the feature is on.
§Task budget
The alarm aggregator is one task for the whole service, not one per
camera: it reads the already-merged event bus. The workspace budget
allows no feature more than one task per camera, and events already
spends that one.
Methods from Deref<Target = CameraService>§
Sourcepub fn subscribe_events(&self) -> Receiver<Event>
pub fn subscribe_events(&self) -> Receiver<Event>
Attach to the merged analytics-event stream from all cameras.
Sourcepub fn spawned_task_count(&self) -> usize
pub fn spawned_task_count(&self) -> usize
How many long-lived tasks this service spawned.
One supervised link per task. The workspace budget allows no feature
more than one task per camera, and tests/task_budget.rs asserts it
against this number.
Trait Implementations§
Source§impl Deref for AppStateInner
So a handler written against the service keeps working unchanged.
impl Deref for AppStateInner
So a handler written against the service keeps working unchanged.
Source§type Target = CameraService
type Target = CameraService
The resulting type after dereferencing.
Source§fn deref(&self) -> &CameraService
fn deref(&self) -> &CameraService
Dereferences the value.
Auto Trait Implementations§
impl !RefUnwindSafe for AppStateInner
impl !UnwindSafe for AppStateInner
impl Freeze for AppStateInner
impl Send for AppStateInner
impl Sync for AppStateInner
impl Unpin for AppStateInner
impl UnsafeUnpin for AppStateInner
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