[−][src]Crate binary_enclave
binary_enclave
allows storing configuration data in a binary directly. You
will probably never find a good reason for doing this. This is primarily an
exercise for learning rust and something I found interesting.
nightly warning this currently requires nightly for
const_fn
andconst_generics
Caveats
- Written payload is only visible upon next execution.
Basic Usage
ⓘ
use serde::{Serialize, Deserialize}; use binary_enclave::{enclave, Enclave}; #[derive(Default, Serialize, Deserialize)] struct Config { some: u32, values: String }; #[enclave(appconfig)] pub static CONFIG: Enclave<Config, 128> = Enclave::new(); fn main() -> Result<(), Box<dyn std::error::Error>> { let conf = CONFIG.decode()?; let res = CONFIG.write(&Config{ some: 43, values: "see".to_string() })?; Ok(()) }
Structs
Enclave | Our enclave that will store the serialized value within our binary |
Enums
Error | Error that can be produced reading/writing to the Enclave |
Type Definitions
Result | Result for Enclave operations |
Attribute Macros
enclave | setup required linker options and trait impls |