ic-memory 0.56.4

Durable stable-memory allocation governance for Internet Computer canisters
Documentation
// Fixture-only Wire contract compiled by the canister and the native runner.
use ic_wire::Limits;
use serde::{Deserialize, Serialize};

pub const REQUEST: Limits = Limits {
    bytes: 128,
    allocation: 4096,
    nodes: 128,
    depth: 8,
};
pub const RESPONSE: Limits = REQUEST;

pub const INIT_ID: u64 = 0x4d45_4d51_0000_0001;
pub const UPGRADE_ID: u64 = 0x4d45_4d51_0000_0002;
pub const SNAPSHOT_ID: u64 = 0x4d45_4d51_0000_0003;
pub const IO_ID: u64 = 0x4d45_4d51_0000_0004;
pub const COMPOSITION_ID: u64 = 0x4d45_4d51_0000_0005;
pub const METADATA_FAULT_ID: u64 = 0x4d45_4d51_0000_0006;

///
/// Snapshot
///
/// Passive fixture observation; never allocation authority.
///

#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub struct Snapshot {
    pub generation: u64,
    pub markers: [u8; 2],
    pub physical_pages: u64,
    pub rows_pages: u64,
}

///
/// IoRequest
///
/// One bounded request for the fixture's measured IO loop.
///

#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub struct IoRequest {
    pub operation: u8,
    pub count: u8,
    pub offset: u64,
}

///
/// IoReply
///
/// Destination bytes and the loop's actual instruction count.
///

#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub struct IoReply {
    pub bytes: [u8; 2],
    pub instructions: u64,
}