diagnostics_hierarchy/serialization/
mod.rs

1// Copyright 2019 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5//! Inspect Format
6//!
7//! This module provides utilities for formatting a `DiagnosticsHierarchy`.
8//! Currently the only available format is JSON.
9//!
10//! ## JSON Example
11//!
12//! If you'd like to format a single hierarchy
13//!
14//! ```
15//! let hierarchy = DiagnosticsHierarchy::new(...);
16//! let json_string = serde_json::to_string(&hierarchy)?;
17//! ```
18//!
19//! If you'd like to deserialize some json string, you can do the following:
20//! ```
21//! let string = "{ ... }".to_string();
22//! let hierarchy : DiagnosticsHierarchy = serde_json::from_str(&string);
23//! ```
24
25mod deserialize;
26mod serialize;
27pub(crate) use serialize::maybe_condense_histogram;