Skip to main content

Crate zerodds_ast_layout

Crate zerodds_ast_layout 

Source
Expand description

Crate zerodds-ast-layout. Safety classification: SAFE.

Wire layout planning over the common AST. Produces alignment, extent, header framing and offsets per (encoding, endianness, purpose); codecs execute the plan, this crate never moves sample bytes.

Every wire rule lives here exactly once. The duplication across fifteen code emitters that this rebuild removes had its cost in divergence, most recently in the length-code framing of variable-length @mutable members.

§Spec

  • docs/specs/zerodds-ast-1.0.md §7 (layout view).
  • OMG XTypes 1.3 §7.4 (wire encoding), §7.4.1.2 (PL_CDR1), §7.4.2 (Plain CDR2 / Delimited CDR2 / PL_CDR2), §7.6.8 (KeyHash).
  • DDSI-RTPS 2.5 §9.6.3.8 (KeyHash), §10 (encapsulation).

§Layer position

Layer 2 — over zerodds-ast.

Re-exports§

pub use axes::AXES;
pub use axes::AxisFlag;
pub use axes::DialectLowering;
pub use axes::DialectSettings;
pub use axes::dialect_help;
pub use axes::dialect_names;
pub use axes::dialect_settings_from_overrides;
pub use cache::LayoutCache;
pub use key::AggregateDelimiter;
pub use key::ArrayElementFlattening;
pub use key::CollectionDelimiterPolicy;
pub use key::DefaultedDiscriminatorMember;
pub use key::Dialect;
pub use key::ElementPadding;
pub use key::Encoding;
pub use key::Endianness;
pub use key::EnumHolderWidth;
pub use key::EnumeratorValue;
pub use key::FixedDigitCount;
pub use key::KeyHolderAlignment;
pub use key::KeyHolderExtensibility;
pub use key::KeyHolderNesting;
pub use key::KeyHolderOrder;
pub use key::LayoutKey;
pub use key::LengthCodePolicy;
pub use key::MapDelimiter;
pub use key::MapEntryOrder;
pub use key::MapKeyOrdering;
pub use key::MustUnderstandPolicy;
pub use key::MutableUnionFraming;
pub use key::OffsetKey;
pub use key::PidFlagPolicy;
pub use key::PlCdr1FramingValues;
pub use key::PlCdr1HeaderPolicy;
pub use key::PlCdr1Reading;
pub use key::Purpose;
pub use key::SequenceElementDelimiter;
pub use key::ShortPidRange;
pub use key::UnionLabelMatch;
pub use key::WcharFraming;
pub use key::WcharPosition;
pub use key::WcharWidth;
pub use key::WirePosition;
pub use key::WstringCodeUnits;
pub use key::WstringLengthCounts;
pub use key::WstringLengthPolicy;
pub use key::WstringTerminator;
pub use key::WstringUnitOrder;
pub use key::WstringUnitWidth;
pub use keyhash::KEY_HASH_LEN;
pub use keyhash::KeyHashForm;
pub use keyhash::holder_keeps_only_keys;
pub use keyhash::key_hash_form;
pub use keyhash::key_holder_plan;
pub use keyhash::key_holder_plan_with;
pub use keyhash::key_members;
pub use keyhash::key_members_with;
pub use keyhash::member_key;
pub use keyhash::union_key_discriminator;
pub use plan::Extent;
pub use plan::LayoutError;
pub use plan::LengthCode;
pub use plan::MemberHeader;
pub use plan::MemberPlan;
pub use plan::Offset;
pub use plan::TypeLayout;
pub use xcdr::DepCollector;
pub use xcdr::PID_EXTENDED;
pub use xcdr::PID_LIST_END;
pub use xcdr::PID_SHORT_MAX_ID;
pub use xcdr::PID_SHORT_MAX_LEN;
pub use xcdr::PL_CDR1_ALIGNMENT;
pub use xcdr::array_is_delimited;
pub use xcdr::collection_is_delimited;
pub use xcdr::enumeration_bit_bound;
pub use xcdr::enumerator_wire_value;
pub use xcdr::extensibility_of;
pub use xcdr::fixed_wire_digits;
pub use xcdr::length_code;
pub use xcdr::map_key_ordering;
pub use xcdr::member_held_inline_closes_a_cycle;
pub use xcdr::member_must_understand;
pub use xcdr::needs_extended_pid;
pub use xcdr::plan;
pub use xcdr::primitive_layout;
pub use xcdr::sequence_element_carries_length;
pub use xcdr::types_that_close_an_inadmissible_cycle;
pub use xcdr::union_negative_matches_nothing;

Modules§

axes
Wire axes: the flags that pick one peer’s departure from the specification at a time.
cache
The layout cache. Spec §7.
key
Layout keys. Spec §7.
keyhash
Key-holder planning. DDSI-RTPS 2.5 §9.6.3.8, XTypes 1.3 §7.6.8.
plan
Layout plans. Spec §7.
xcdr
XCDR1 and XCDR2 layout planning. OMG XTypes 1.3 §7.4.

Functions§

keeps_short_header
Whether a member of this type keeps the short header in a sample past the step: a primitive or an enumeration, through any alias.