Encode a JSON value as MessagePack bytes for storage. If encoding fails (should not happen for valid `serde_json::Value`), falls back to JSON bytes.
(value: &serde_json::Value)
| 71 | /// If encoding fails (should not happen for valid `serde_json::Value`), |
| 72 | /// falls back to JSON bytes. |
| 73 | pub(super) fn encode_to_msgpack(value: &serde_json::Value) -> Vec<u8> { |
| 74 | nodedb_types::json_to_msgpack(value).unwrap_or_else(|_| { |
| 75 | // Fallback: store as JSON if MessagePack encoding fails. |
| 76 | sonic_rs::to_vec(value).unwrap_or_default() |
| 77 | }) |
| 78 | } |
| 79 | |
| 80 | /// Convert JSON bytes to MessagePack bytes. |
| 81 | /// |
no test coverage detected