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/ptr_meta # 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 / ptr_meta` `1096131` feat(artifact): add Ed25519 trust and host tooling Drake committed 2026-09-25 ``` .. src/ .cargo-checksum.json 971 .cargo_vcs_info.json 102 Cargo.lock 1350 Cargo.toml 1203 Cargo.toml.orig 619 LICENSE 1053 README.md 2056 example.md 1344 ``` README.md # `ptr_meta` crates.io badge docs badge license badge A radioactive stabilization of the `ptr_meta` RFC . ## Documentation - ptr_meta , the core library - ptr_meta_derive , proc macros for implementing `Pointee` for structs and trait objects ## Example ``` // Get the associated metadata for pointers let str = "hello world"; assert_eq!(ptr_meta::metadata(str), str.len()); let slice = &[1, 2, 3, 4, 5] as &[i32]; assert_eq!(ptr_meta::metadata(slice), slice.len()); // Make your own wide pointers from data pointers and metadata let bytes = [b'h', b'e', b'l', b'l', b'o']; let ptr = ptr_meta::from_raw_parts::(bytes.as_ptr().cast(), 5); println!("{} world!", unsafe { &*ptr }); // prints "hello world!" // Derive Pointee on your own types #[derive(ptr_meta::Pointee)] #[repr(transparent)] struct CoolStr { inner: str, } impl CoolStr { fn print_cool(&self) { println!("😎 {} 😎", &self.inner); } } let ptr = ptr_meta::from_raw_parts::(bytes.as_ptr().cast(), 5); let cool = unsafe { &*ptr }; cool.print_cool(); // prints "😎 hello 😎" // Implement Pointee for trait objects #[ptr_meta::pointee] trait Printable { fn print(&self); } impl Printable for i32 { fn print(&self) { println!("i32: {self}"); } } let i32_vtable = ptr_meta::metadata(&0i32 as &dyn Printable); let one_hundred = 100i32; let printable = ptr_meta::from_raw_parts::( (&one_hundred as *const i32).cast(), i32_vtable, ); unsafe { (*printable).print(); // prints "i32: 100" } ```