pub struct SharedPicker(/* private fields */);Expand description
Thread-safe shared handle to the FilePicker instance.
Uses parking_lot::RwLock which is reader-fair — new readers are not
blocked when a writer is waiting, preventing search query stalls during
background bigram builds or watcher writes.
Clone gives a new handle to the same picker (Arc clone).
Default creates an empty handle suitable for Lazy::new(SharedPicker::default).
Implementations§
pub fn read(&self) -> Result<RwLockReadGuard<'_, Option<FilePicker>>, Error>
pub fn write(&self) -> Result<RwLockWriteGuard<'_, Option<FilePicker>>, Error>
Sourcepub fn need_complex_rebuild(&self) -> bool
pub fn need_complex_rebuild(&self) -> bool
Return true if this is an instance of the picker that requires a complicated post-scan
indexing/cache warmup job. The indexing is not crazy but it takes time.
Sourcepub fn wait_for_scan(&self, timeout: Duration) -> bool
pub fn wait_for_scan(&self, timeout: Duration) -> bool
Block until the background filesystem scan finishes.
Returns true if scan completed, false on timeout.
Sourcepub fn wait_for_watcher(&self, timeout: Duration) -> bool
pub fn wait_for_watcher(&self, timeout: Duration) -> bool
Block until the background file watcher is ready.
Returns true if watcher ready, false on timeout.
Sourcepub fn refresh_git_status(
&self,
shared_frecency: &SharedFrecency,
) -> Result<usize, Error>
pub fn refresh_git_status( &self, shared_frecency: &SharedFrecency, ) -> Result<usize, Error>
Refresh git statuses for all indexed files.
Trait Implementations§
Source§fn clone(&self) -> SharedPicker
fn clone(&self) -> SharedPicker
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§fn default() -> SharedPicker
fn default() -> SharedPicker
Auto Trait Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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