use core::mem::offset_of;
pub(super) const INPUT_BUFFER_SIZE: usize = 256;
pub(super) const TRANSIENT_BUFFER_SIZE: usize = 2 * INPUT_BUFFER_SIZE;
#[repr(C)]
pub(super) struct Layout {
here: usize,
latest: usize,
state: usize,
base: usize,
to_in: usize,
source_addr: usize,
source_len: usize,
source_id: usize,
sp0: usize,
rp0: usize,
input: [u8; INPUT_BUFFER_SIZE],
transient: [u8; TRANSIENT_BUFFER_SIZE],
diagnostic_addr: usize,
diagnostic_len: usize,
}
impl Layout {
pub const HERE: usize = offset_of!(Self, here);
pub const LATEST: usize = offset_of!(Self, latest);
pub const STATE: usize = offset_of!(Self, state);
pub const BASE: usize = offset_of!(Self, base);
pub const TO_IN: usize = offset_of!(Self, to_in);
pub const SOURCE_ADDR: usize = offset_of!(Self, source_addr);
pub const SOURCE_LEN: usize = offset_of!(Self, source_len);
pub const SOURCE_ID: usize = offset_of!(Self, source_id);
pub const SP0: usize = offset_of!(Self, sp0);
pub const RP0: usize = offset_of!(Self, rp0);
pub const INPUT: usize = offset_of!(Self, input);
pub const TRANSIENT: usize = offset_of!(Self, transient);
pub const DIAGNOSTIC_ADDR: usize = offset_of!(Self, diagnostic_addr);
pub const DIAGNOSTIC_LEN: usize = offset_of!(Self, diagnostic_len);
pub const DATA: usize = size_of::<Self>();
}