Skip to main content

Module named

Module named 

Source
Expand description

Code for resolving name grid lines and areas

StructsΒ§

AreaLines πŸ”’
The one-indexed positions of the first line that starts and the first line that ends a named grid area in each axis, i.e. the first line named <area-name>-start/<area-name>-end (explicitly or by grid-template-areas). A value of 0 means that there is no such line.
GridLineNames
The names of each explicit grid line in a single axis, stored in CSR (compressed sparse row) format: a single flat Vec of names plus a Vec of offsets into it (one more offset than there are lines). The names of line i (0-indexed) are names[offsets[i]..offsets[i + 1]].
GridLineNamesIter
Iterator over the per-line name groups of a GridLineNames. Yields one &[S] per grid line (which is empty for unnamed lines)
NamedLineResolver πŸ”’
Resolver that takes grid lines names and area names as input and can then be used to resolve line names of grid placement properties into line numbers.
NamedLineResolverAxis πŸ”’
Resolver for named placements in one grid axis
StrHasher πŸ”’
Wrap an AsRef<str> type with a type which implements Hash by first deferring to the underlying &str’s implementation of Hash.

FunctionsΒ§

oz_line πŸ”’
The named line maps store lines as 1-based β€œCSS Grid Line” numbers (which are always within the explicit grid). Convert one to OriginZero coordinates.
split_area_edge_name πŸ”’
Split a line name of the form <area-name>-start or <area-name>-end into the area name and the edge
upsert_line_name_map πŸ”’
Utility function to create or update an entry in a line name map

Type AliasesΒ§

GridAreasMap πŸ”’
Map from the name of a grid area to the lines of its edges.
LinePositions πŸ”’
The one-indexed line positions of a single grid line name. Inline capacity of 4 keeps the type the same size as Vec<u32> (24 bytes) while avoiding a heap allocation for names mapping to at most 4 lines (the common case)
NamedGridLinesMap πŸ”’
Map from a grid line name to its one-indexed line positions