zerodds_ast/facet/flatdata.rs
1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2026 ZeroDDS Contributors
3//! FlatData and zero-copy properties. Spec §4.5.
4
5/// FlatData information attached to a node. Spec §4.5.
6///
7/// `is_plain` is recorded rather than derived on the spot because a
8/// frontend may assert it — a vendor extension can declare a type plain
9/// — and because the derivation walks the whole reachable graph.
10#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)]
11pub struct FlatDataFacet {
12 /// Whether the type is plain: fixed size, no indirection, loanable
13 /// without serialisation.
14 pub is_plain: bool,
15 /// Alignment the zero-copy loan path requires.
16 pub loan_alignment: Option<u8>,
17 /// Whether the frontend asked for fixed-size layout explicitly
18 /// rather than the property being inferred.
19 pub explicit_fixed_layout: bool,
20}