pub struct ProjectSearchState {
pub query: String,
pub options: ProjectSearchOptions,
pub status: SearchStatus,
pub total_hits: usize,
pub scan_task: Option<JoinHandle<()>>,
pub cancel_token: CancellationToken,
pub source_paths: HashMap<BufferId, PathBuf>,
}Expand description
Per-view state owned by ProjectSearchService.
Fields§
§query: String§options: ProjectSearchOptions§status: SearchStatus§total_hits: usize§scan_task: Option<JoinHandle<()>>§cancel_token: CancellationTokenM.6.6 (2026-06-08): cooperative cancellation token. The blocking
scan loop checks it at each file iteration and exits early when
it fires. spawn_blocking tasks ignore JoinHandle abort —
only this token reaches the blocking thread.
CG.2 (2026-08-08): was a private Arc<AtomicBool> flipped by
the refresh handler for supersede. It is now the editor’s
foreground token, armed through ForegroundCancelHandle, so
<C-g> reaches a running scan and supersede stops being a
second, parallel mechanism that cancellation did not know about.
ForegroundCancel::arm cancels its predecessor, which is
exactly what the refresh handler used to do by hand.
source_paths: HashMap<BufferId, PathBuf>M.6.1: source BufferId → on-disk path. Populated by the
provider-minor’s forwarder as it loads files into the
view’s source map. The mode’s <CR> handler (M.10.3,
registered via ActionHandlerRegistry from
on_activate) reads this to resolve the excerpt under
cursor back to a file path.
Implementations§
Source§impl ProjectSearchState
impl ProjectSearchState
Sourcepub fn scanning(
query: String,
options: ProjectSearchOptions,
cancel: CancellationToken,
) -> Self
pub fn scanning( query: String, options: ProjectSearchOptions, cancel: CancellationToken, ) -> Self
CG.2: cancel is the armed foreground token the scan will
poll — take it as an argument rather than defaulting to
never(), so a spawn site physically cannot register a scan
that <C-g> has no way to reach.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProjectSearchState
impl RefUnwindSafe for ProjectSearchState
impl Send for ProjectSearchState
impl Sync for ProjectSearchState
impl Unpin for ProjectSearchState
impl UnsafeUnpin for ProjectSearchState
impl UnwindSafe for ProjectSearchState
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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 more