#[repr(C)]pub struct LayoutHeader {
pub magic: u32,
pub version: u16,
pub flags: u16,
pub capabilities: u32,
pub layout_bytes: u32,
}Expand description
Shared-memory layout header for ABI/version checks.
Keep this at the start of any region you expect to map across processes (and potentially across versions).
Fields§
§magic: u32Magic value identifying an IndexBus-mapped region.
version: u16ABI version number.
flags: u16Layout flags (reserved for future use).
capabilities: u32Capability bitset indicating which optional features/sections are present.
layout_bytes: u32v1: total size in bytes of the shared layout that starts with this header.
Initializers should set this to the full byte length of the mapped layout they created. Consumers should validate that their mapping is at least this length before accessing appended sections.
Implementations§
Source§impl LayoutHeader
impl LayoutHeader
Sourcepub const fn new_v1(capabilities: u32, flags: u16) -> Self
pub const fn new_v1(capabilities: u32, flags: u16) -> Self
Construct a v1 header with layout_bytes left as 0.
Initializers should fill layout_bytes after they know the full mapping length.
Sourcepub const fn new_v1_with_layout_bytes(
capabilities: u32,
flags: u16,
layout_bytes: u32,
) -> Self
pub const fn new_v1_with_layout_bytes( capabilities: u32, flags: u16, layout_bytes: u32, ) -> Self
Construct a v1 header with an explicit layout_bytes value.
Sourcepub const fn is_compatible_v1(&self) -> bool
pub const fn is_compatible_v1(&self) -> bool
Returns true if this header matches the v1 magic and version.
This only checks the ABI identifier and version. Callers should separately validate
layout_bytes and required capabilities.
Trait Implementations§
Source§impl Clone for LayoutHeader
impl Clone for LayoutHeader
Source§fn clone(&self) -> LayoutHeader
fn clone(&self) -> LayoutHeader
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more