# Open Meeting 2024-05-29 ## IoMem abstraction https://lore.kernel.org/rust-for-linux/ZkzptG6fJx-MJ_6s@pollux/ ```rust struct Io<T>(*mut T); impl Io<[u8]> { fn try_readb(offset: usize) -> Result<u8> { ... } } impl<N: usize> Io<[u8; N]> { fn readb(offset: usize) -> u8 { build_assert!(offset + 1 <= N); ... } } ``` Field projection: ```rust #[repr(C)] struct MyDevice { foo: u32, bar: u32, } let io: &Io<MyDevice> = ...; project!(io => foo).read() ``` Code generation / proc macros... ## syn Debian/Federa is happy to provide source package of syn at a fixed location Distros suggest to use cargo to find the local source packages Probably use `cargo metadata` to find out the path. ##
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up