pub struct RegistryIndex {
pub skill: Vec<IndexedSkill>,
pub source: Vec<IndexSource>,
}Fields§
§skill: Vec<IndexedSkill>§source: Vec<IndexSource>Implementations§
Source§impl RegistryIndex
impl RegistryIndex
pub fn validate(&self) -> Result<()>
Sourcepub fn search(&self, query: &str) -> Vec<(&IndexedSkill, f64)>
pub fn search(&self, query: &str) -> Vec<(&IndexedSkill, f64)>
Scores and ranks skills against a whitespace-separated query.
Every term must match somewhere in a skill (name, namespace,
description, or tags) for the skill to be included at all —
same AND semantics as before. What’s new is where a term
matched now affects ranking: a hit in the name or tags counts
for much more than a hit buried in the description, so a
query term that merely appears in unrelated prose no longer
ranks a skill as highly as one that’s actually about that
term. Results are sorted best-match-first (ties broken
alphabetically by qualified_name() for stable output).
Trait Implementations§
Source§impl Clone for RegistryIndex
impl Clone for RegistryIndex
Source§fn clone(&self) -> RegistryIndex
fn clone(&self) -> RegistryIndex
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RegistryIndex
impl Debug for RegistryIndex
Source§impl Default for RegistryIndex
impl Default for RegistryIndex
Source§fn default() -> RegistryIndex
fn default() -> RegistryIndex
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for RegistryIndex
impl<'de> Deserialize<'de> for RegistryIndex
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for RegistryIndex
impl RefUnwindSafe for RegistryIndex
impl Send for RegistryIndex
impl Sync for RegistryIndex
impl Unpin for RegistryIndex
impl UnsafeUnpin for RegistryIndex
impl UnwindSafe for RegistryIndex
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