17 releases (2 stable)

Uses new Rust 2024

1.0.1 Sep 11, 2025
1.0.0 Jun 25, 2025
0.25.1 Jun 4, 2025
0.24.0-alpha.3 Mar 19, 2025
0.18.7 Nov 28, 2022

#12 in #internet-computer

Download history 15998/week @ 2025-10-13 19884/week @ 2025-10-20 16752/week @ 2025-10-27 20134/week @ 2025-11-03 16797/week @ 2025-11-10 21294/week @ 2025-11-17 16154/week @ 2025-11-24 17213/week @ 2025-12-01 15226/week @ 2025-12-08 14534/week @ 2025-12-15 11295/week @ 2025-12-22 10039/week @ 2025-12-29 11580/week @ 2026-01-05 14386/week @ 2026-01-12 16194/week @ 2026-01-19 13921/week @ 2026-01-26

57,671 downloads per month
Used in 218 crates (9 directly)

Apache-2.0

57KB
844 lines

Bindings to the Internet Computer system API.

The raw bindings can be found in the [sys] module. The functions in the crate root provide slightly higher-level bindings in terms of slices instead of pointers/lengths, accurately typed pointers, etc., but otherwise does not adapt the API. Where this is all that is needed for the functions to be safe, they are marked as safe, but function pointers cannot be made safe and as such call_new is still unsafe.

Any function ic0.foo that would write to a user buffer has two versions, foo which takes &mut [u8] and foo_uninit which takes &mut [MaybeUninit<u8>].


ic0

Internet Computer System API binding.

What

ic0 is simply a safe Rust translation of the System API as described in the IC interface specification. The unsafe direct imports can be found in the ic0::sys module.

Update

ic0 keeps in step with the IC interface specification. Particularly, ic0 is directly generated from the system API in that repo.

When interface-spec releases a new version that modify system API:

  1. replace ic0.txt in the root of this project;
  2. copy any new function headers to manual_safety_comments.txt, and add a safety comment for the function;
  3. execute cargo run --example=ic0build;

src/sys.rs should be updated.

No runtime deps