[][src]Function holochain_json_api::json::default_to_json

pub fn default_to_json<V: Serialize + Debug>(v: V) -> JsonString

if all you want to do is implement the default behaviour then use #[derive(DefaultJson)] should only be used with From for JsonString i.e. when failure should be impossible so an expect is ok this is always true for serializable structs/enums standard boilerplate: impl From for JsonString { fn from(v: MyStruct) -> Self { default_to_json(v) } }