Skip to main content

javm_cap/
lib.rs

1#![cfg_attr(not(feature = "std"), no_std)]
2
3//! JAR v3 capability system.
4//!
5//! Defines the five v3 cap kinds (Instance, Image, Data, CNode, Type),
6//! their content-bearing representations, a two-tier cache for
7//! identity-keyed mutable state + content-addressed blobs, and the
8//! primitives (BMT, hash) used by upstream layers.
9//!
10//! `Cap` and its inner storage use the default `Global` allocator (=
11//! std heap on host, talc on guest via `#[global_allocator]`). The
12//! cache layer's outer storage (`HashMap` / `Box` parameters) may still
13//! be parameterised on a custom allocator for shared-memory layouts.
14//!
15//! See `~/jar/website/content/spec/implementation/architecture.md` for
16//! the crate's role in the overall layering.
17
18#[macro_use]
19extern crate alloc;
20
21pub mod abi;
22pub mod cache;
23pub mod cap;
24pub mod cap_hash;
25pub mod cnode;
26pub mod data;
27pub mod error;
28pub mod hash;
29pub mod image;
30pub mod image_cap;
31pub mod instance;
32pub mod page;
33pub mod slot;
34pub mod wire;
35
36#[cfg(test)]
37mod cap_tests;
38
39pub use cache::{CacheDirectory, CacheError};
40pub use cap::{
41    Cap, CapHash, CapHashOrRef, CapKind, CapRef, MAX_ENDPOINTS, MAX_SOURCE_DEPTH, NUM_REGS, TypeCap,
42};
43pub use cap_hash::cap_hash;
44pub use cnode::{CNodeCap, CNodeSlotEntry};
45pub use data::{DataCap, DataContent, PAGE_SIZE};
46pub use error::{CapError, OpError};
47pub use hash::{Blake2b256, Hash};
48pub use image::{
49    EndpointDef as ImageEndpointDef, Image, InitialDataCap, MemoryMapping as ImageMemoryMapping,
50    PinnedCap, chain_extend, chain_genesis, image_content_hash,
51};
52pub use image_cap::{
53    EndpointDef, ImageCap, ImageConvertError, ImageSlotEntry, MemoryMapping, image_cap,
54};
55pub use instance::{InstanceCap, RwOverlay};
56pub use page::{PageBytes, PageRef, PageSlot};
57pub use slot::{SlotIdx, SlotPath};