Skip to main content

ic_memory/
lib.rs

1#![forbid(unsafe_code)]
2#![deny(rustdoc::broken_intra_doc_links)]
3#![doc = include_str!("../README.md")]
4
5//! Persistent allocation-governance primitives for Internet Computer stable
6//! memory.
7//!
8//! The crate models durable ownership as `stable_key -> allocation_slot
9//! forever`. It intentionally does not own framework namespaces, controller
10//! authorization, endpoint lifecycle, schema migrations, or Canic-specific
11//! memory ID policy.
12
13pub mod bootstrap;
14pub mod declaration;
15pub mod diagnostics;
16pub mod generation;
17pub mod key;
18pub mod ledger;
19pub mod physical;
20pub mod policy;
21pub mod schema;
22pub mod session;
23pub mod slot;
24pub mod substrate;
25pub mod validation;
26
27pub use bootstrap::{
28    AllocationBootstrap, BootstrapCommit, BootstrapError, BootstrapReservationError,
29    BootstrapRetirementError,
30};
31pub use declaration::{
32    AllocationDeclaration, DeclarationCollector, DeclarationSnapshot, DeclarationSnapshotError,
33};
34pub use diagnostics::{DiagnosticExport, DiagnosticGeneration, DiagnosticRecord};
35pub use generation::{GenerationCommit, GenerationMutation, StagedGeneration};
36pub use key::{StableKey, StableKeyError};
37pub use ledger::{
38    AllocationHistory, AllocationLedger, AllocationRecord, AllocationReservationError,
39    AllocationRetirement, AllocationRetirementError, AllocationStageError, AllocationState,
40    CURRENT_LEDGER_SCHEMA_VERSION, CURRENT_PHYSICAL_FORMAT_ID, GenerationRecord, LedgerCodec,
41    LedgerCommitError, LedgerCommitStore, LedgerCompatibility, LedgerCompatibilityError,
42    LedgerIntegrityError, SchemaMetadataRecord,
43};
44pub use physical::{
45    AuthoritativeSlot, CommitRecoveryError, CommitSlotDiagnostic, CommitSlotIndex,
46    CommitStoreDiagnostic, CommittedGenerationBytes, DualCommitStore, DualProtectedCommitStore,
47    ProtectedGenerationSlot, select_authoritative_slot,
48};
49pub use policy::{AllocationPolicy, NamespaceAuthority, RangeAuthority};
50pub use schema::{SchemaMetadata, SchemaMetadataError};
51pub use session::{AllocationSession, AllocationSessionError, ValidatedAllocations};
52pub use slot::{
53    AllocationSlot, AllocationSlotDescriptor, MEMORY_MANAGER_DESCRIPTOR_VERSION,
54    MEMORY_MANAGER_INVALID_ID, MEMORY_MANAGER_MAX_ID, MEMORY_MANAGER_MIN_ID,
55    MEMORY_MANAGER_SUBSTRATE, MemoryManagerIdRange, MemoryManagerRangeError,
56    MemoryManagerSlotError, validate_memory_manager_id,
57};
58pub use substrate::{LedgerAnchor, StorageSubstrate};
59pub use validation::{AllocationValidationError, validate_allocations};