MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / current_snapshots

Method current_snapshots

crates/openshell-driver-docker/src/lib.rs:646–661  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

644 }
645
646 async fn current_snapshots(&self) -> Result<Vec<DriverSandbox>, Status> {
647 let containers = self.list_managed_container_summaries().await?;
648 let container_sandboxes = containers
649 .iter()
650 .filter_map(|summary| {
651 sandbox_from_container_summary(summary, self.supervisor_readiness.as_ref())
652 })
653 .collect::<Vec<_>>();
654 let mut by_id = self.pending_snapshot_map().await;
655 for sandbox in container_sandboxes {
656 by_id.insert(sandbox.id.clone(), sandbox);
657 }
658 let mut sandboxes = by_id.into_values().collect::<Vec<_>>();
659 sandboxes.sort_by(|left, right| left.id.cmp(&right.id));
660 Ok(sandboxes)
661 }
662
663 async fn create_sandbox_inner(&self, sandbox: &DriverSandbox) -> Result<(), Status> {
664 let validated = Self::validated_sandbox(sandbox, &self.config)?;

Callers 3

current_snapshot_mapMethod · 0.45
list_sandboxesMethod · 0.45
watch_sandboxesMethod · 0.45

Tested by

no test coverage detected