pub struct IndexManager { /* private fields */ }Expand description
索引管理器
管理项目级别的索引,包括符号索引、路由索引和组件索引。 使用 RwLock 保护索引结构,因为重建索引时需要整体替换。
Implementations§
Source§impl IndexManager
impl IndexManager
Sourcepub async fn build(&self, workspace: &Workspace)
pub async fn build(&self, workspace: &Workspace)
构建索引(异步,可能耗时)
在后台线程构建索引,完成后原子性地替换整个索引。 这确保读取者看到的是完整的旧索引或完整的新索引,而不会看到中间状态。
Sourcepub fn find_symbol(&self, name: &str) -> Vec<SymbolInfo>
pub fn find_symbol(&self, name: &str) -> Vec<SymbolInfo>
查找符号
Sourcepub fn find_component(&self, name: &str) -> Option<ComponentInfo>
pub fn find_component(&self, name: &str) -> Option<ComponentInfo>
查找组件
Sourcepub fn get_all_routes(&self) -> Vec<RouteInfo>
pub fn get_all_routes(&self) -> Vec<RouteInfo>
获取所有路由
Trait Implementations§
Auto Trait Implementations§
impl Freeze for IndexManager
impl RefUnwindSafe for IndexManager
impl Send for IndexManager
impl Sync for IndexManager
impl Unpin for IndexManager
impl UnwindSafe for IndexManager
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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 more