Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aienux/tree/main/vendor/generic-array # aienux Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aienux / vendor / generic-array` `1096131` feat(artifact): add Ed25519 trust and host tooling Drake committed 2026-09-25 ``` .. src/ .cargo-checksum.json 1560 .cargo_vcs_info.json 94 CHANGELOG.md 4533 Cargo.toml 1584 Cargo.toml.orig 1123 LICENSE 1107 README.md 1777 build.rs 146 ``` README.md Crates.io Build Status # generic-array This crate implements generic array types for Rust. Requires minumum Rust version of 1.36.0, or 1.41.0 for `From<[T; N]>` implementations Documentation ## Usage The Rust arrays `[T; N]` are problematic in that they can't be used generically with respect to `N`, so for example this won't work: ``` struct Foo { data: [i32; N] } ``` generic-array defines a new trait `ArrayLength` and a struct `GenericArray>`, which let the above be implemented as: ``` struct Foo> { data: GenericArray } ``` The `ArrayLength` trait is implemented by default for unsigned integer types from typenum crate: ``` use generic_array::typenum::U5; struct Foo> { data: GenericArray } fn main() { let foo = Foo::{data: GenericArray::default()}; } ``` For example, `GenericArray` would work almost like `[T; 5]`: ``` use generic_array::typenum::U5; struct Foo> { data: GenericArray } fn main() { let foo = Foo::{data: GenericArray::default()}; } ``` In version 0.1.1 an `arr!` macro was introduced, allowing for creation of arrays as shown below: ``` let array = arr![u32; 1, 2, 3]; assert_eq!(array[2], 3); ```