validate_state_layout

Function validate_state_layout 

Source
pub fn validate_state_layout<const STATE_MAX: usize>(
    layout: &StateLayout<STATE_MAX>,
) -> Result<(), Error>
Expand description

Validate a mapped StateLayout<STATE_MAX>.

Checks:

  • v1 header compatibility (magic/version)
  • required capabilities (state)
  • layout_bytes is large enough for the base layout
  • NOTE: state regions do not use an initialized: 0/1/2 field in v1; they rely on the seq parity protocol (even = stable, odd = writer in progress)
  • if INDEXBUS_CAP_SUPPORTS_BLOCKING is set, ensures the mapping is large enough to hold an appended StateWakeSection at the next 64B boundary