Skip to main content

is_append_compatible

Function is_append_compatible 

Source
pub const fn is_append_compatible<Old: FixedLayout, New: FixedLayout>() -> bool
Expand description

Check if a migration from OldLayout to NewLayout would be append-compatible.

Append-compatible means:

  • New layout is strictly larger
  • The first old_size bytes can stay as-is
  • Only new fields were added at the end

This is a compile-time check helper – use in tests and CI.