Skip to main content

Module mapping

Module mapping 

Source

Functions§

cbor_to_json
Convert a CborValue to a serde_json::Value for final output.
extract_confidence
Extract output.confidence as Option<f64> from a BrickResult’s output.
merge_maps
Merge two CborValue maps deeply. Keys from overlay overwrite keys in base. Preserves stable key order: existing keys stay in place, new keys appended. Non-map values: overlay wins.
resolve_path
Resolve a dot-path from a CborValue map. e.g., resolve_path(value, “output.label”) traverses into nested maps. Returns None if any segment is missing or the value is not a map at an intermediate step. Empty path returns the value itself.
set_path
Build a nested CborValue map from a dot-path and a value. e.g., set_path(“input.sentiment”, val) → Map { “input”: Map { “sentiment”: val } } Empty path returns the value itself.