Skip to content
This repository was archived by the owner on May 9, 2022. It is now read-only.

feat(rtc_types): add serialization helpers: byte_formats::rkyv_format #93

Merged
merged 4 commits into from
Jun 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
218 changes: 159 additions & 59 deletions Cargo.lock

Large diffs are not rendered by default.

52 changes: 52 additions & 0 deletions rtc_auth_enclave/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 52 additions & 0 deletions rtc_data_enclave/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 52 additions & 0 deletions rtc_exec_enclave/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 52 additions & 0 deletions rtc_tenclave/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions rtc_types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,16 @@ teaclave_sgx = ["thiserror_sgx", "sgx_tstd"]
[dependencies]
sgx_types = { git = "https://github.com/apache/incubator-teaclave-sgx-sdk.git", rev = "b9d1bda", features = ["extra_traits"] }

# no_std libraries
rkyv = { version = "0.6.6", default_features = false, features = ["const_generics", "strict"] }

# default
thiserror = { version = "1.0.24", optional = true}

# teaclave_sgx
thiserror_sgx = { git = "https://github.com/mesalock-linux/thiserror-sgx.git", package = "thiserror", optional = true }
sgx_tstd = { git = "https://github.com/apache/incubator-teaclave-sgx-sdk.git", rev = "b9d1bda", features = ["backtrace"], optional = true }

[dev-dependencies]
proptest = "1.0.0"
proptest-derive = "0.3.0"
22 changes: 22 additions & 0 deletions rtc_types/src/byte_formats/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//! Helpers for serializing the types in this library to various byte formats.
//!
//! # Naming convention
//!
//! Sub-modules should be named `{name}_format`, for each binary format implemented.
//!
//! Functions in each module use the following naming convention:
//!
//! > `(write|read|view)_(array|slice)`
//!
//! 1. Operation:
//!
//! - `write` to serialize a structure to bytes
//! - `read` to deserialize bytes to a new Rust structure (copying data)
//! - `view` to deserialize bytes to a structured view (sharing data)
//!
//! 2. Type suffix, for the byte representation:
//!
//! - `array` for working with constant-sized arrays (`[u8; ?]`)
//! - `slice` for working with variable-sized slices (`[u8]`)

pub mod rkyv_format;
Loading