pub struct ItemQuery {
pub sort: ItemSort,
pub filter: ItemFilter,
}Expand description
What the user chose for one library: its order and what it keeps.
What an app saves per library, and asks Items with
(ItemQuery::to_request).
Fields§
§sort: ItemSort§filter: ItemFilterImplementations§
Source§impl ItemQuery
impl ItemQuery
Sourcepub fn is_default(&self) -> bool
pub fn is_default(&self) -> bool
The library as Items gives it with neither: title A to Z, every
item.
Sourcepub fn to_request(&self) -> (Option<ItemSort>, Option<ItemFilter>)
pub fn to_request(&self) -> (Option<ItemSort>, Option<ItemFilter>)
What to ask Items with: the default order and an empty filter
are left out, as the server’s own, so the plain listing stays the
one a cache keeps.
Sourcepub fn sort_by(&mut self, key: SortKey)
pub fn sort_by(&mut self, key: SortKey)
Ordered by key: picked again, the other way round; else title
A to Z first, any other key largest, newest or last first.
Sourcepub fn has(&self, value: &FilterValue) -> bool
pub fn has(&self, value: &FilterValue) -> bool
Whether it keeps items with value; names case aside.
Sourcepub fn toggle(&mut self, value: &FilterValue)
pub fn toggle(&mut self, value: &FilterValue)
Keeps items with value too, or no longer if it did.
Sourcepub fn set_years(&mut self, from: Option<u16>, to: Option<u16>)
pub fn set_years(&mut self, from: Option<u16>, to: Option<u16>)
From from to to, either open. A To before the From is moved up
to it, so the range is never back to front (which Items
refuses).
Sourcepub fn reset(&mut self, part: FilterPart)
pub fn reset(&mut self, part: FilterPart)
Without part: the other parts and the sort stay.