#[non_exhaustive]pub struct ControllerSnapshot {
pub slots: Vec<SlotView>,
}controller only.Expand description
A rolling read-only view of the slots tracked by one controller.
Each SlotView reports one slot’s owner, status, pending depth, and time in that status.
Entries appear in slot-key order.
§Consistency
The controller does not read every slot at one exact moment. A slot created during collection may be absent. A removed slot may still appear. Any state can change after this value is returned. Commands still waiting in the controller command queue do not appear until the controller processes them.
This struct is non-exhaustive. Use .. when matching it.
§Examples
if let Some(snapshot) = handle.controller_snapshot().await {
println!(
"{} running, {} queued",
snapshot.running_count(),
snapshot.total_queued(),
);
if let Some(deploy) = snapshot.slot("deploy") {
println!("deploy: {:?}, queued: {}", deploy.status, deploy.queue_depth);
}
}Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.slots: Vec<SlotView>Captured slots in slot-key order.
Implementations§
Source§impl ControllerSnapshot
impl ControllerSnapshot
Sourcepub fn running_count(&self) -> usize
pub fn running_count(&self) -> usize
Counts captured slots in the exact SlotStatusKind::Running state.
This excludes Admitting and Terminating, including runtime-accepted owners already being retired.
It is not a count of task bodies polling at this exact moment.
Sourcepub fn total_queued(&self) -> usize
pub fn total_queued(&self) -> usize
Counts pending submissions across all captured slot queues.
This includes replacements waiting at the front of a queue and excludes current owners.
Trait Implementations§
Source§impl Clone for ControllerSnapshot
impl Clone for ControllerSnapshot
Source§fn clone(&self) -> ControllerSnapshot
fn clone(&self) -> ControllerSnapshot
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more