Skip to main content

page_size

Function page_size 

Source
pub const fn page_size(physical_page_size: u32) -> NonZeroU16
Expand description

The logical page size whose physical page occupies exactly physical_page_size bytes on disk (see the module docs on storage-page alignment).

This selects a page size for a store. It is not a migration path: a store that already holds data cannot be reopened under a different page size, as the mismatched pages fail their integrity check and reopening for writing silently truncates them. Changing page size is a destructive format migration.

ยงPanics

Panics if physical_page_size is not a power of two, does not exceed the CRC record size, or yields a logical size that does not fit a u16, so misconfiguration is caught at construction (or compile time, in const contexts).