Skip to main content

LibraryItems

Trait LibraryItems 

Source
pub trait LibraryItems<K: Key> {
    // Required methods
    fn len(&self) -> usize;
    fn key(&self, index: usize) -> K;
    fn label(&self, index: usize) -> String;

    // Provided methods
    fn is_empty(&self) -> bool { ... }
    fn marks(&self, index: usize) -> Marks { ... }
    fn stack(&self, index: usize) -> Option<Stack<K>> { ... }
    fn badges(&self, index: usize) -> Vec<Badge> { ... }
    fn revision(&self) -> u64 { ... }
}
Expand description

The images a library shows; the application owns them.

Required Methods§

Source

fn len(&self) -> usize

Source

fn key(&self, index: usize) -> K

Image index’s key (the selection is kept by key).

Source

fn label(&self, index: usize) -> String

Its name: the cell’s accessible name and caption.

Provided Methods§

Source

fn is_empty(&self) -> bool

Source

fn marks(&self, index: usize) -> Marks

Its rating, labels and flag.

Source

fn stack(&self, index: usize) -> Option<Stack<K>>

The stack it belongs to.

Source

fn badges(&self, index: usize) -> Vec<Badge>

Its badges.

Source

fn revision(&self) -> u64

Changes whenever stacks change without the count changing: the view then works out again which images it shows.

Implementors§