Skip to main content

Module layout_direction_serde

Module layout_direction_serde 

Source
Expand description

serde adapter for Attributes::dir. lumen-core carries no serde dependency, so LayoutDirection cannot derive Serialize/Deserialize itself; this module maps Option<LayoutDirection> to a stable, compact Option<u8> (0 = Auto, 1 = Ltr, 2 = Rtl) for the AOT artifact. Keeping the mapping here (rather than adding serde to lumen-core) keeps the parser-independent runtime free of an extra core dependency.

Functionsยง

deserialize
Deserialize Option<u8> back into Option<LayoutDirection>. Unknown tags degrade to LayoutDirection::Auto, mirroring the From<&str> parser fallback.
serialize
Serialize Option<LayoutDirection> as Option<u8>.