pub struct Navigator { /* private fields */ }Expand description
Navigator orchestrates documentation lookup across multiple sources
Sources are checked in this order:
- std (if crate name matches RUST_CRATES)
- local (if LocalSource is present and has the crate)
- docs.rs (if DocsRsSource is present)
Implementations§
pub fn std_source(&self) -> Option<&StdSource>
pub fn with_std_source(self, std_source: Option<StdSource>) -> Self
pub fn docsrs_source(&self) -> Option<&DocsRsSource>
pub fn with_docsrs_source(self, docsrs_source: Option<DocsRsSource>) -> Self
pub fn local_source(&self) -> Option<&LocalSource>
pub fn with_local_source(self, local_source: Option<LocalSource>) -> Self
Sourcepub fn list_available_crates(&self) -> impl Iterator<Item = &CrateInfo>
pub fn list_available_crates(&self) -> impl Iterator<Item = &CrateInfo>
List all available crate names from all sources Returns crate names from std library and local workspace/dependencies
Sourcepub fn lookup_crate<'a>(
&'a self,
name: &str,
version: &VersionReq,
) -> Option<Cow<'a, CrateInfo>>
pub fn lookup_crate<'a>( &'a self, name: &str, version: &VersionReq, ) -> Option<Cow<'a, CrateInfo>>
Look up a crate by name, returning canonical name and metadata Tries sources in priority order: std, local, docs.rs
Sourcepub fn project_root(&self) -> Option<&Path>
pub fn project_root(&self) -> Option<&Path>
Get the project root path if a local context exists
Sourcepub fn resolve_path<'a>(
&'a self,
path: &str,
suggestions: &mut Vec<Suggestion<'a>>,
) -> Option<DocRef<'a, Item>>
pub fn resolve_path<'a>( &'a self, path: &str, suggestions: &mut Vec<Suggestion<'a>>, ) -> Option<DocRef<'a, Item>>
Resolve a path like “std::vec::Vec” or “tokio::runtime::Runtime” or (custom format for this crate) “tokio@1::runtime::Runtime” or “serde@1.0.228::de”
This is the primary string entrypoint for any user-generated crate or type specification
pub fn canonicalize(&self, name: &str) -> CrateName<'static>
Sourcepub fn load_crate(
&self,
name: &str,
version_req: &VersionReq,
) -> Option<&RustdocData>
pub fn load_crate( &self, name: &str, version_req: &VersionReq, ) -> Option<&RustdocData>
Load a crate by name and optional version
If version is None:
- First checks external crate names from loaded crates
- For local context crates: use the locked version from Cargo.lock
- For arbitrary crates: use “latest”
Returns None if the crate cannot be found in any source
Sourcepub fn search<'nav, 'query>(
&'nav self,
query: &'query str,
crate_names: &'query [&'query str],
) -> Result<Vec<ScoredResult<'query>>, Vec<Suggestion<'nav>>>
pub fn search<'nav, 'query>( &'nav self, query: &'query str, crate_names: &'query [&'query str], ) -> Result<Vec<ScoredResult<'query>>, Vec<Suggestion<'nav>>>
Search across multiple crates with BM25 scoring
Returns results sorted by score (descending). Empty crate list returns empty results. Empty query triggers index loading but returns no matches (useful for prewarming).
Returns Err with suggestions if no crates could be loaded/indexed.
Trait Implementations§
Auto Trait Implementations§
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.