MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / artifact_bytes

Method artifact_bytes

mserver/MasterService/src/mods.rs:390–403  ·  view source on GitHub ↗

Raw bytes of a published mod's artifact, or `None` if absent. Rejects ids that could escape the store prefix.

(&self, mod_id: &str)

Source from the content-addressed store, hash-verified

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 {

Calls 3

is_safe_segmentFunction · 0.85
store_pathMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected