Skip to main content

SectionProvider

Trait SectionProvider 

Source
pub trait SectionProvider: 'static {
    // Required methods
    fn section_count(&self) -> usize;
    fn items_in_section(&self, section: usize) -> usize;
    fn section_title(&self, section: usize) -> String;

    // Provided method
    fn section_counts(&self) -> Vec<usize> { ... }
}
Expand description

Partitions a flat model into display sections.

Required Methods§

Source

fn section_count(&self) -> usize

Number of sections.

Source

fn items_in_section(&self, section: usize) -> usize

Number of items in section.

Source

fn section_title(&self, section: usize) -> String

Display title for section.

Provided Methods§

Source

fn section_counts(&self) -> Vec<usize>

Per-section item counts, in order. Used by the layout strategy.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§