Crates.io | parr |
lib.rs | parr |
version | |
source | src |
created_at | 2024-10-06 20:08:59.666244 |
updated_at | 2024-10-12 16:19:49.827392 |
description | A C-like unknown-length array type. |
homepage | |
repository | https://github.com/andofwinds/parr |
max_upload_size | |
id | 1399363 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
let arr: Parr<u8> = Parr::new(&[11_u8, 22, 33, 44] as *const _ as u64);
assert_eq!(arr[1], 22);
Same code in C:
uint8_t arr[] = {11, 22, 33, 44};
// arr[1] == 22
#[repr(C)]
struct Foo {
arr: Parr<u8>,
}
Same code in C:
struct foo {
uint8_t* arr,
};
extern "C" fn foo(arr: Parr<u8>) { }
Same code in C:
void foo(uint8_t* arr) { }