pub struct BrowseQuery<'a> { /* private fields */ }Expand description
What browse keeps from the package index and in what order.
Implementations§
Source§impl<'a> BrowseQuery<'a>
impl<'a> BrowseQuery<'a>
Sourcepub fn new() -> Self
pub fn new() -> Self
A query with r2modman’s browse defaults: deprecated and NSFW packages hidden, community-pinned packages first, then most recently updated first.
Sourcepub fn pinned_first(self, first: bool) -> Self
pub fn pinned_first(self, first: bool) -> Self
Puts packages the community pinned ahead of the rest when first is
true. Each group is sorted on its own.
Sourcepub fn sort(self, key: SortKey, direction: SortDirection) -> Self
pub fn sort(self, key: SortKey, direction: SortDirection) -> Self
Orders packages by key in direction. Packages with equal keys keep
their index order.
Sourcepub fn show_deprecated(self, show: bool) -> Self
pub fn show_deprecated(self, show: bool) -> Self
Keeps packages marked deprecated when show is true.
Sourcepub fn show_nsfw(self, show: bool) -> Self
pub fn show_nsfw(self, show: bool) -> Self
Keeps packages marked as having NSFW content when show is true.
Sourcepub fn search(self, search: &'a str) -> Self
pub fn search(self, search: &'a str) -> Self
Keeps packages matching every word of search, split on whitespace and
underscores. A word matches when the package’s name, owner, or latest
description contains it, ignoring case.
Under SortKey::BestMatch, keeps every package that matches by name,
owner, description, or a one-letter typo in a word of five or more
letters, and ranks them: exact name, exact Owner-Name, name prefix,
search words starting name words, name substring, owner prefix, whole
words, substrings, typos. Packages that rank equally lead with more
downloads and a better rating. Case, _, -, spaces, and camelCase
breaks are ignored, so valheim plus matches ValheimPlus.
Sourcepub fn categories(self, categories: impl IntoIterator<Item = &'a str>) -> Self
pub fn categories(self, categories: impl IntoIterator<Item = &'a str>) -> Self
Keeps packages in at least one of categories. No categories keeps
every package.