pub struct StdlibView { /* private fields */ }Expand description
The standard library modules one reader can use, from Stdlib::view.
Docs, search, suggestions and the catalog all read this one set, so none
of them advertises what another leaves out.
Implementations§
Source§impl StdlibView
impl StdlibView
Sourcepub fn declaration(&self, name: &str) -> Option<&PackageDeclaration>
pub fn declaration(&self, name: &str) -> Option<&PackageDeclaration>
The narrowed declaration of the module name.
Sourcepub fn resolve(&self, name: &str) -> Resolution
pub fn resolve(&self, name: &str) -> Resolution
resolve over the view.
Sourcepub fn suggest_filtered(
&self,
name: &str,
extra: &[String],
visible: impl Fn(&str) -> bool,
) -> Option<String>
pub fn suggest_filtered( &self, name: &str, extra: &[String], visible: impl Fn(&str) -> bool, ) -> Option<String>
suggest_filtered over the view.
Sourcepub fn catalog_filtered(
&self,
extra: Vec<CatalogEntry>,
visible: impl Fn(&str) -> bool,
) -> Catalog
pub fn catalog_filtered( &self, extra: Vec<CatalogEntry>, visible: impl Fn(&str) -> bool, ) -> Catalog
catalog_filtered over the view.
Sourcepub fn match_bare_name(&self, name: &str, extra: &[String]) -> BareNameMatch
pub fn match_bare_name(&self, name: &str, extra: &[String]) -> BareNameMatch
A bare name against this view’s module tails, plus any extra full names
the caller can also resolve (registry packages, @mcp/<server>).
fs is not a package name; it is the tail of submilli:fs. An exact,
unique tail is that module. A tail shared with another visible name is
ambiguous — serving one would hide the other. A name that already has a
scheme or scope is a miss here: it was written as a package name, and a
typo of one is an edit-distance question, not a forgotten prefix.
Sourcepub fn has_bare_tail(&self, name: &str) -> bool
pub fn has_bare_tail(&self, name: &str) -> bool
Whether name is a bare name whose exact tail is a module in this view.
Lets a caller skip building other catalogs when it is not.