pub struct DetailedGridTracksInfo<S: CheapCloneStr = String> {
pub negative_implicit_tracks: u16,
pub explicit_tracks: u16,
pub positive_implicit_tracks: u16,
pub positions: Vec<Line<f32>>,
pub line_names: GridLineNames<S>,
}Expand description
Information from the computation of grids tracks
Fields§
§negative_implicit_tracks: u16Number of leading implicit grid tracks
explicit_tracks: u16Number of explicit grid tracks
positive_implicit_tracks: u16Number of trailing implicit grid tracks
positions: Vec<Line<f32>>The start and end position of each track relative to the grid container’s border box.
These positions account for the container’s border and padding, the gap property,
content alignment (align-content/justify-content), and collapsed tracks.
line_names: GridLineNames<S>The names of each explicit grid line. Stored line i (0-indexed) bounds the start of
explicit track i; use DetailedGridTracksInfo::names_for_line or
DetailedGridTracksInfo::iter_line_names for indices relative to the full grid
(including implicit tracks). Empty if the grid has no named lines.
Implementations§
Source§impl<S: CheapCloneStr> DetailedGridTracksInfo<S>
impl<S: CheapCloneStr> DetailedGridTracksInfo<S>
Sourcefn resolve_absolute_grid_axis(
&self,
placement: Line<GridPlacement<S>>,
padding_start: f32,
padding_end: f32,
is_reversed: bool,
) -> Line<f32>
fn resolve_absolute_grid_axis( &self, placement: Line<GridPlacement<S>>, padding_start: f32, padding_end: f32, is_reversed: bool, ) -> Line<f32>
Resolve an absolute placement in this axis to physical start and end coordinates
Source§impl<S: CheapCloneStr> DetailedGridTracksInfo<S>
impl<S: CheapCloneStr> DetailedGridTracksInfo<S>
Sourcefn positions_from_grid_track_layout(grid_tracks: &[GridTrack]) -> Vec<Line<f32>>
fn positions_from_grid_track_layout(grid_tracks: &[GridTrack]) -> Vec<Line<f32>>
Get the start and end position of each track relative to the grid container’s border box
Sourcefn from_grid_tracks_and_track_count(
track_count: TrackCounts,
grid_tracks: Vec<GridTrack>,
line_names: GridLineNames<S>,
) -> Self
fn from_grid_tracks_and_track_count( track_count: TrackCounts, grid_tracks: Vec<GridTrack>, line_names: GridLineNames<S>, ) -> Self
Construct DetailedGridTracksInfo from TrackCounts and GridTracks
Sourcepub fn names_for_line(&self, line_index: usize) -> &[S]
pub fn names_for_line(&self, line_index: usize) -> &[S]
The names of the grid line with the passed 0-indexed line index, where line i bounds
the start of track i of the full grid (including implicit tracks).
Returns an empty slice if the line has no names or the index is out of range.
Sourcepub fn iter_line_names(&self) -> GridLineNamesIter<'_, S> ⓘ
pub fn iter_line_names(&self) -> GridLineNamesIter<'_, S> ⓘ
Iterate over the name group (&[S]) of each grid line of the full grid (including
implicit tracks) in line order, yielding empty groups for unnamed (implicit) lines.
Yields nothing if the grid has no named lines.
Sourcepub fn write_track_list(&self, out: &mut impl Write) -> Result
pub fn write_track_list(&self, out: &mut impl Write) -> Result
Write the used track sizes and line names of this axis to the passed writer in the
resolved value format of the grid-template-rows/grid-template-columns properties
(see https://www.w3.org/TR/css-grid-1/#resolved-track-list)
Sourcepub fn to_track_list_string(&self) -> String
pub fn to_track_list_string(&self) -> String
Serialize the used track sizes and line names of this axis in the resolved value format of
the grid-template-rows/grid-template-columns properties
(see https://www.w3.org/TR/css-grid-1/#resolved-track-list)
Trait Implementations§
Source§impl<S: Clone + CheapCloneStr> Clone for DetailedGridTracksInfo<S>
impl<S: Clone + CheapCloneStr> Clone for DetailedGridTracksInfo<S>
Source§fn clone(&self) -> DetailedGridTracksInfo<S>
fn clone(&self) -> DetailedGridTracksInfo<S>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<S: Debug + CheapCloneStr> Debug for DetailedGridTracksInfo<S>
impl<S: Debug + CheapCloneStr> Debug for DetailedGridTracksInfo<S>
Source§impl<S: PartialEq + CheapCloneStr> PartialEq for DetailedGridTracksInfo<S>
impl<S: PartialEq + CheapCloneStr> PartialEq for DetailedGridTracksInfo<S>
Source§fn eq(&self, other: &DetailedGridTracksInfo<S>) -> bool
fn eq(&self, other: &DetailedGridTracksInfo<S>) -> bool
self and other values to be equal, and is used by ==.