MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / decode

Method decode

gateway/src/kv/mod.rs:391–400  ·  view source on GitHub ↗
(&self, key: &str)

Source from the content-addressed store, hash-verified

389
390impl GetPutCodec for NodeState {
391 fn decode<T: for<'de> serde::Deserialize<'de>>(&self, key: &str) -> Option<T> {
392 self.get(key)
393 .and_then(|entry| match decode(entry.value.as_ref()?) {
394 Ok(value) => Some(value),
395 Err(e) => {
396 warn!("failed to decode value for key {key}: {e:?}");
397 None
398 }
399 })
400 }
401
402 fn put_encoded<T: serde::Serialize>(&mut self, key: String, value: &T) -> Result<()> {
403 self.put(key.clone(), encode(value)?)

Callers 15

read_utf8Function · 0.45
requestMethod · 0.45
show_logsMethod · 0.45
create_app_composeMethod · 0.45
decodePrpcErrorFunction · 0.45
get_quoteMethod · 0.45
attestMethod · 0.45
emit_eventMethod · 0.45
signMethod · 0.45
verifyMethod · 0.45
tdx_quoteMethod · 0.45
decode_keyMethod · 0.45

Calls 3

decodeFunction · 0.85
getMethod · 0.45
as_refMethod · 0.45

Tested by

no test coverage detected