MCPcopy Create free account
hub / github.com/hashintel/hash / try_decode

Method try_decode

libs/@local/hashql/eval/src/orchestrator/codec/decode/mod.rs:394–405  ·  view source on GitHub ↗

Deserializes a column value into the expected type, or returns an error. The `column` parameter is only used for error reporting; it identifies which result column failed to deserialize.

(
        &self,
        r#type: TypeId,
        value: JsonValueRef<'_>,
        column: Indexed<ColumnDescriptor>,
    )

Source from the content-addressed store, hash-verified

392 /// The `column` parameter is only used for error reporting;
393 /// it identifies which result column failed to deserialize.
394 pub(crate) fn try_decode(
395 &self,
396 r#type: TypeId,
397 value: JsonValueRef<'_>,
398 column: Indexed<ColumnDescriptor>,
399 ) -> Result<Value<'heap, A>, BridgeError<'heap>>
400 where
401 A: Clone,
402 {
403 self.decode(r#type, value)
404 .map_err(|source| BridgeError::ValueDeserialization { column, source })
405 }
406}

Callers 7

hydrate_from_postgresMethod · 0.80
hydrate_decision_timeMethod · 0.80
hydrate_web_idMethod · 0.80
hydrate_entity_uuidMethod · 0.80
hydrate_draft_idMethod · 0.80
hydrate_edition_idMethod · 0.80

Calls 2

map_errMethod · 0.80
decodeMethod · 0.45

Tested by

no test coverage detected