Skip to main content

GenericRepetition

Trait GenericRepetition 

Source
pub trait GenericRepetition {
    type CustomIdent: CheapCloneStr;
    type RepetitionTrackList<'a>: Iterator<Item = TrackSizingFunction> + ExactSizeIterator + Clone
       where Self: 'a;
    type TemplateLineNames<'a>: TemplateLineNames<'a, Self::CustomIdent>
       where Self: 'a;

    // Required methods
    fn count(&self) -> RepetitionCount;
    fn tracks(&self) -> Self::RepetitionTrackList<'_>;
    fn lines_names(&self) -> Self::TemplateLineNames<'_>;

    // Provided method
    fn track_count(&self) -> u16 { ... }
}
Expand description

A trait to represent a repeat() clause in a grid-template-* definition

Required Associated Types§

Source

type CustomIdent: CheapCloneStr

The type that represents <custom-ident>s (for named lines)

Source

type RepetitionTrackList<'a>: Iterator<Item = TrackSizingFunction> + ExactSizeIterator + Clone where Self: 'a

The type which represents an iterator over the list of repeated tracks

Source

type TemplateLineNames<'a>: TemplateLineNames<'a, Self::CustomIdent> where Self: 'a

A nested iterator of line names (nested because each line may have multiple associated names)

Required Methods§

Source

fn count(&self) -> RepetitionCount

The repetition count (integer, auto-fill, or auto-fit)

Source

fn tracks(&self) -> Self::RepetitionTrackList<'_>

Get an iterator over the repeated tracks

Source

fn lines_names(&self) -> Self::TemplateLineNames<'_>

Returns an iterator over the lines names

Line name sets are positional: set i names the ith line of each repetition. The iterator must yield either no line name sets at all (all lines are unnamed) or exactly track_count() + 1 of them (one set per line, including both edge lines).

Provided Methods§

Source

fn track_count(&self) -> u16

Returns the number of repeated tracks

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§