sp1_lib::io

Function read

Source
pub fn read<T: DeserializeOwned>() -> T
Expand description

Read a deserializable object from the input stream.

§Examples

use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize)]
struct MyStruct {
    a: u32,
    b: u32,
}

let data: MyStruct = sp1_zkvm::io::read();