Raw bytes of a published mod's artifact, or `None` if absent. Rejects ids that could escape the store prefix.
(&self, mod_id: &str)
| 388 | let bytes = serde_json::to_vec(&CurrentRevision { |
| 389 | package_revision: revision, |
| 390 | })?; |
| 391 | self.store |
| 392 | .put( |
| 393 | &self.store_path(Self::current_path(mod_id)), |
| 394 | Bytes::from(bytes).into(), |
| 395 | ) |
| 396 | .await |
| 397 | .with_context(|| format!("advancing {mod_id} to revision {revision}"))?; |
| 398 | } else { |
| 399 | result.with_context(|| format!("advancing {mod_id} to revision {revision}"))?; |
| 400 | } |
| 401 | Ok(()) |
| 402 | } |
| 403 | |
| 404 | async fn current_state(&self, mod_id: &str) -> Result<Option<CurrentState>> { |
| 405 | let path = self.store_path(Self::current_path(mod_id)); |
| 406 | match self.store.get(&path).await { |
no test coverage detected