cannon_io/lib.rs
1//! A crate to allow Cannon guest programs written in Rust to communicate with the host
2//!
3//! The Cannon host provides a number of ways for the guest to write outputs and request data. This crate provides simple and safe wrappers
4//! around the low level syscalls that implement these features. Note that this crate can only be used when building for a MIPS32 target.
5//!
6//! The main features of this crate are exposed in the prelude which can be imported with `import cannon_io::prelude::*;`.
7//! This imports the `oracle_reader`, `exit`, and `print` functions along with the `PreimageKey` and `Read` traits.
8
9#![no_std]
10#![feature(asm_experimental_arch)]
11
12extern crate alloc;
13
14pub mod logger;
15pub mod oracle;
16pub mod syscalls;
17
18/// Prelude imports commonly used functions and traits
19pub mod prelude {
20 pub use crate::oracle::{oracle_reader, PreimageKey, Read};
21 pub use crate::syscalls::{exit, print, read_hint, write_hint};
22}