kernel_sidecar/jupyter/metadata.rs
1/*
2Used building Message<T>, see message.rs
3
4Ref: https://jupyter-client.readthedocs.io/en/latest/messaging.html#metadata
5*/
6use bytes::Bytes;
7use serde::{Deserialize, Serialize};
8
9#[derive(Debug, Clone, Serialize, Deserialize)]
10pub struct Metadata(serde_json::Value);
11
12impl From<Bytes> for Metadata {
13 fn from(bytes: Bytes) -> Self {
14 Metadata(serde_json::from_slice(&bytes).expect("Error deserializing metadata"))
15 }
16}