≈ the.bay.news

Nested #[repr(c)] in rust struct

The Rust Programming Language Forum
Nested #[repr(c)] in rust struct
I have the following struct which I receive via ffi #[repr(C)] #[derive(Clone, Copy)] pub struct CDROM_TOC { pub Length: [u8; 2], pub FirstTrack: u8, pub LastTrack: u8, pub TrackData: [TRACK_DATA; 100], } #[repr(C)] #[derive(Clone, Copy)] pub struct TRACK_DATA { pub Reserved: u8, pub _bitfield: u8, pub TrackNumber: u8, pub Reserved1: u8, pub Address: [u8; 4], } I then store this in: pub struct CdDrive { path: PathBuf, handle: DriveHandle, toc: ...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.