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

Method deserialize

crates/openshell-providers/src/profiles.rs:506–534  ·  view source on GitHub ↗
(deserializer: D)

Source from the content-addressed store, hash-verified

504
505impl<'de> Deserialize<'de> for BinaryProfile {
506 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
507 where
508 D: Deserializer<'de>,
509 {
510 #[derive(Deserialize)]
511 #[serde(untagged)]
512 enum BinaryProfileInput {
513 Path(String),
514 Object(BinaryProfileObject),
515 }
516
517 #[derive(Deserialize)]
518 struct BinaryProfileObject {
519 path: String,
520 #[serde(default)]
521 harness: bool,
522 }
523
524 match BinaryProfileInput::deserialize(deserializer)? {
525 BinaryProfileInput::Path(path) => Ok(Self {
526 path,
527 harness: false,
528 }),
529 BinaryProfileInput::Object(binary) => Ok(Self {
530 path: binary.path,
531 harness: binary.harness,
532 }),
533 }
534 }
535}
536
537fn default_category() -> ProviderProfileCategory {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected