Skip to main content

ic_memory_key

Macro ic_memory_key 

Source
macro_rules! ic_memory_key {
    (authority = CANIC_CORE_MEMORY_AUTHORITY, key = $stable_key:literal, ty = $label:path, id = $id:expr $(,)?) => { ... };
    (authority = CANIC_CONTROL_PLANE_MEMORY_AUTHORITY, key = $stable_key:literal, ty = $label:path, id = $id:expr $(,)?) => { ... };
    (authority = $authority:literal, key = $stable_key:literal, ty = $label:path, id = $id:expr $(,)?) => { ... };
    (authority = $authority:path, key = $stable_key:literal, ty = $label:path, id = $id:expr $(,)?) => { ... };
}
Expand description

Declare a stable-memory slot with an explicit authority and ABI-stable key.

Use this for every Canic-managed memory. The stable key, not crate or Rust type identity, is the durable allocation identity.