Apologies if this is not the right place for these sort of questions but I haven't found a solution even though I would have though that it is a fairly common task - which makes me think I might be going about it all wrong.
One of the main things I need to be ale to do is to read and write 512byte blocks to an SD card - I would like these 'blocks' to be structs so that individual fields can be read/written to, these would then be converted to a byte array for reading/writing to the storage.
The structure below is an example of the sort of approach I'm currently using - I was hoping to use `zerocopy` with `AsBytes` but the no-padding requirements seem to exclude this. Unfortuantly the data structure cannot be changed (at least for now).

```rust
#[repr(u16)]
pub enum BlockType {
    Unknown = 0,
    BlockA = BLOCKTYPE_A,
    BlockB = BLOCKTYPE_B,
}
const BLOCK_CONTENTS_SIZE_BYTES:usize=504;

#[repr(C)]
pub struct Block {
    block_type: BlockType,
    pub cyc_num: u16,
    pub contents: [u8; BLOCK_CONTENTS_SIZE_BYTES],
    crc: u32,
}

#[repr(C)]
pub struct BlockContentsA {
    field_a: u32,
    field_b: i32,
    field_c: i32,
    field_d: f32,
    field_e: f32,
    field_f: f64,
    field_g: f32,
    field_h: u32,
    field_i: u32,
    field_j: u8,
    some_chars: [u8; 32],
    padding: [u8; 431],
}
```