diagnostics_hierarchy/serialization/
mod.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

//! Inspect Format
//!
//! This module provides utilities for formatting a `DiagnosticsHierarchy`.
//! Currently the only available format is JSON.
//!
//! ## JSON Example
//!
//! If you'd like to format a single hierarchy
//!
//! ```
//! let hierarchy = DiagnosticsHierarchy::new(...);
//! let json_string = serde_json::to_string(&hierarchy)?;
//! ```
//!
//! If you'd like to deserialize some json string, you can do the following:
//! ```
//! let string = "{ ... }".to_string();
//! let hierarchy : DiagnosticsHierarchy = serde_json::from_str(&string);
//! ```

mod deserialize;
mod serialize;
pub(crate) use serialize::maybe_condense_histogram;