Crates.io | c_struct_layout |
lib.rs | c_struct_layout |
version | 0.1.3 |
source | src |
created_at | 2024-11-06 20:27:24.426949 |
updated_at | 2024-11-21 02:51:18.335881 |
description | A library for enforcing stable, C-compatible data layouts in Rust. |
homepage | |
repository | |
max_upload_size | |
id | 1438836 |
size | 3,737 |
A library for enforcing stable, C-compatible data layouts in Rust.
#[repr(C)]
.check_layout
method to verify the layout at runtime (basic implementation).To use c_struct_layout
, add the following to your Cargo.toml
:
[dependencies]
c_struct_layout = "0.1.0"
use c_struct_layout::CStructLayout;
#[derive(CStructLayout)]
#[repr(C)]
struct MyData {
x: u32,
y: f64,
}
fn main() {
MyData::check_layout();
}
The check_layout method is a placeholder for verifying struct layouts. You can expand it with more detailed checks if needed.
This project is licensed under the MIT License
bensatlantik