Expand description
Code for resolving name grid lines and areas
StructsΒ§
- Area
Lines π - 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 bygrid-template-areas). A value of 0 means that there is no such line. - Grid
Line Names - The names of each explicit grid line in a single axis, stored in CSR (compressed sparse
row) format: a single flat
Vecof names plus aVecof offsets into it (one more offset than there are lines). The names of linei(0-indexed) arenames[offsets[i]..offsets[i + 1]]. - Grid
Line Names Iter - Iterator over the per-line name groups of a
GridLineNames. Yields one&[S]per grid line (which is empty for unnamed lines) - Named
Line πResolver - 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.
- Named
Line πResolver Axis - 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>-startor<area-name>-endinto 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Β§
- Grid
Areas πMap - Map from the name of a grid area to the lines of its edges.
- Line
Positions π - 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) - Named
Grid πLines Map - Map from a grid line name to its one-indexed line positions