pub struct Index { /* private fields */ }Available on crate feature
index only.Expand description
A snapshot of the index of publicly available ASIMOV modules.
Implementations§
Source§impl Index
impl Index
Sourcepub async fn fetch() -> Result<Self, FetchIndexError>
pub async fn fetch() -> Result<Self, FetchIndexError>
Fetches the index from INDEX_URL.
pub async fn fetch_from( client: &Client, url: impl AsRef<str>, ) -> Result<Self, FetchIndexError>
pub fn modules(&self) -> &[ModuleManifest]
Sourcepub fn search(
&self,
query: impl AsRef<str>,
) -> impl Iterator<Item = &ModuleManifest>
pub fn search( &self, query: impl AsRef<str>, ) -> impl Iterator<Item = &ModuleManifest>
Searches the index for modules matching the given query.
The query is split into whitespace-separated terms, and a module matches when every term occurs, case-insensitively, as a substring of any of the module’s name, label, title, summary, links, provided programs, or handled inputs. An empty query matches every module.
The matching modules are returned in index order.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Index
impl RefUnwindSafe for Index
impl Send for Index
impl Sync for Index
impl Unpin for Index
impl UnsafeUnpin for Index
impl UnwindSafe for Index
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more