ic-db-cli 0.52.0

Local fixture console for IC DB
Documentation
//! Private Explorer fixture transport. Integer and identity components cross JS as exact text.
use serde::{Deserialize, Serialize};

/// One bounded lookup or live page.
#[derive(Serialize, Deserialize)]
pub struct Request {
    /// Fixture store selector.
    pub store: String,
    /// Qualified entity name.
    pub entity: String,
    /// Continuation for a live page.
    pub after: Option<Vec<u8>>,
    /// Exact primary key components, in declared order.
    pub key: Option<Vec<String>>,
    /// Maximum returned rows.
    pub rows: u8,
    /// Encoded database value budget.
    pub bytes: u16,
}
/// Fixture projection for the browser.
#[derive(Serialize, Deserialize)]
pub struct Page {
    /// Hex schema fingerprint.
    pub fingerprint: String,
    /// Visible column names in row order.
    pub columns: Vec<String>,
    /// Rows in primary order.
    pub rows: Vec<Vec<Cell>>,
    /// Continuation for the same projection.
    pub next: Option<Vec<u8>>,
}
/// Schema supplies scalar types. Separate tags preserve absent, truncated and literal text.
#[derive(Serialize, Deserialize)]
pub enum Cell {
    /// Missing optional value.
    Absent,
    /// Value omitted to fit the budget.
    Truncated,
    /// Lossless text for the declared scalar.
    Scalar(String),
    /// List or ordered set elements.
    Sequence(Vec<Self>),
    /// Ordered key/value pairs.
    Map(Vec<(Self, Self)>),
    /// Named record fields.
    Record(Vec<(String, Self)>),
    /// Selected enum case and optional payload.
    Variant(String, Option<Box<Self>>),
}