ic-db-cli 0.42.0

Local fixture console for IC DB
Documentation
//! Public JSON projection of the local schema inspection reply.

use ic_db_cli::{EntityView, TypeView, lowercase_hex};
use serde::Serialize;

///
/// Document
/// Top-level output of schema --json.
///
#[derive(Serialize)]
pub(super) struct Document<'a> {
    source: &'static str,
    schema_fingerprint: String,
    entities: &'a [EntityView],
    types: &'a [TypeView],
}

impl<'a> Document<'a> {
    pub(super) fn new(
        fingerprint: &[u8; 32],
        entities: &'a [EntityView],
        types: &'a [TypeView],
    ) -> Self {
        Self {
            source: "local_fixture",
            schema_fingerprint: lowercase_hex(fingerprint, ""),
            entities,
            types,
        }
    }
}